Gathering detailed insights and metrics for @0xcryptomag/winston-plus
Gathering detailed insights and metrics for @0xcryptomag/winston-plus
npm install @0xcryptomag/winston-plus
Typescript
Module System
Node Version
NPM Version
69
Supply Chain
97.2
Quality
75.1
Maintenance
100
Vulnerability
100
License
Total Downloads
197
Last Day
2
Last Week
8
Last Month
18
Last Year
197
Minified
Minified + Gzipped
Latest Version
1.0.1
Package Id
@0xcryptomag/winston-plus@1.0.1
Unpacked Size
1.66 MB
Size
1.49 MB
File Count
40
NPM Version
10.8.1
Node Version
20.16.0
Publised On
26 Aug 2024
Cumulative downloads
Total Downloads
Last day
0%
2
Compared to previous day
Last week
100%
8
Compared to previous week
Last month
125%
18
Compared to previous month
Last year
0%
197
Compared to previous year
5
1
My personal additions to @epegzz's winston-dev-console
(based on winston-console-format)
1npm install winston @0xcryptomag/winston-plus
or
1yarn add winston @0xcryptomag/winston-plus
1import { createLogger, format, transports, config } from "winston"; 2import winstonDevConsole from "@epegzz/winston-dev-console"; 3import util from "util"; 4 5let log = createLogger({ 6 levels: config.syslog.levels, 7 level: "debug", // or use process.env.LOG_LEVEL 8}); 9 10// Note: You probably only want to use winstonDevConsole during development 11log = winstonDevConsole.init(log); 12log.add( 13 winstonDevConsole.transport({ 14 showTimestamps: false, 15 addLineSeparation: true, 16 logLevels: config.syslog.levels 17 }) 18); 19 20log.info("Logging initialized"); 21log.debug("Debug an object", { make: "Ford", model: "Mustang", year: 1969 }); 22log.notice("Returned value", { value: util.format }); 23log.alert("Information", { 24 options: ["Lorem ipsum", "dolor sit amet"], 25 values: ["Donec augue eros, ultrices."], 26}); 27log.warn("Warning"); 28log.emerg(new Error("Unexpected error"));
1const { createLogger, format, transports, config } = require("winston"); 2const winstonDevConsole = require("@epegzz/winston-dev-console").default; 3const util = require("util"); 4 5let log = createLogger({ 6 levels: config.syslog.levels, 7 level: "debug", // or use process.env.LOG_LEVEL 8}); 9 10// Note: You probably only want to use winstonDevConsole during development 11log = winstonDevConsole.init(log); 12log.add( 13 winstonDevConsole.transport({ 14 showTimestamps: false, 15 addLineSeparation: true, 16 logLevels: config.cli.levels, 17 }) 18); 19 20log.silly("Logging initialized"); 21log.prompt("Debug an object", { make: "Ford", model: "Mustang", year: 1969 }); 22log.verbose("Returned value", { value: util.format }); 23log.info("Information", { 24 options: ["Lorem ipsum", "dolor sit amet"], 25 values: ["Donec augue eros, ultrices."], 26}); 27log.warn("Warning"); 28log.emerg(new Error("Unexpected error"));
1let tableLog = createLogger({ 2 level: "debug", // or use process.env.LOG_LEVEL 3 levels: config.syslog.levels 4}); 5 6// Note: You probably only want to use winstonDevConsole during development 7tableLog = winstonDevConsole.init(tableLog); 8tableLog.add( 9 winstonDevConsole.transport({ 10 showTimestamps: true, 11 addLineSeparation: true, 12 logLevels: config.syslog.levels, 13 table: true 14 }) 15); 16 17// The first item of the array is reserved for the Table constructor argument which takes in an options object 18// {}, [], '', or null can be used to forego a header/formatting 19tableLog.info("Horizontal Table", [ 20 {head: ['TH 1 label', 'TH 2 label'], colWidths: [25, 25]}, 21 ['First value', 'Second value'], 22 ['First value', 'Second value'] 23]); 24tableLog.notice("Vertical Table", [ 25 {}, 26 { 'Some key': 'Some value' }, 27 { 'Another key': 'Another value' } 28]); 29tableLog.debug("Cross Table", [ 30 { head: [ '', 'Top Header 1', 'Top Header 2' ] }, 31 { 'Left Header 1': [ 'Value Row 1 Col 1', 'Value Row 1 Col 2' ] }, 32 { 'Left Header 2': [ 'Value Row 2 Col 1', 'Value Row 2 Col 2' ] } 33]);
Configuration object.
Type: DevConsoleFormatOptions
util.inspect()
configuration object.
Type: Object
Used to remove the base path of the project when showing the file path of the log statement.
By default anything in the path before (and including) the src
folder will be removed.
Type: String
Wheather or not to separate each log statement with a blank line.
Type: Boolean
Default: true
Wheather or not to show timestamps
During development the timestamps are usually more noise then helpful, therefore disabled by default.
Type: Boolean
Default: false
Used to select the log level severity schema from the three options provided by triple-beam: npm, syslog, and cli
By default this is set to npm log levels
Type: {[k: string]: number}
Default: winston.config.npm.levels
Wheather or not to show meta after the message, callee path, and optional timestamp
Type: boolean
Default: true
Wheather or not the meta lines after the message is outputted as a table rather than a string literal of an object
Use only when the output is expected to always be tablature. A second logger may be required for tables and non tables
Type: boolean
Default: false
This is a fork of @epegzz's winston-dev-console
His project based off of @duccio's winston-console-format
No vulnerabilities found.
No security vulnerabilities found.