modular-log
Advanced tools
Comparing version 0.1.1 to 0.1.2
import * as winston from 'winston'; | ||
import { SummarizerOptions } from './summarizer'; | ||
import { LogLevels } from './definitions.d'; | ||
export { LogLevels } from './definitions.d'; | ||
export interface Logger extends winston.LoggerInstance { | ||
@@ -21,4 +22,8 @@ fatal(msg: string, meta?: any, callback?: () => void): Logger; | ||
}; | ||
export declare function setupConsoleLogger(options: any): void; | ||
export declare function setupFileLogger(options: any): void; | ||
export interface ConsoleLoggerOptions extends winston.ConsoleTransportOptions { | ||
} | ||
export declare function setupConsoleLogger(options?: ConsoleLoggerOptions): void; | ||
export interface FileLoggerOptions extends winston.FileTransportOptions { | ||
} | ||
export declare function setupFileLogger(options?: FileLoggerOptions): void; | ||
export declare function setupSummarizer(options?: SummarizerOptions): void; | ||
@@ -25,0 +30,0 @@ export declare function sumLog(): { |
@@ -19,3 +19,2 @@ "use strict"; | ||
return function (options) { | ||
console.log(options); | ||
var atStr = moment(options.meta.at).format('YYYY-MM-DD hh:mm:ss'); | ||
@@ -39,6 +38,7 @@ useColors && (atStr = colors.gray(atStr)); | ||
options.formatter = createFormatter(true); | ||
transports.push(new winston.transports.Console(options)); | ||
transports.push(new winston.transports.Console(options || {})); | ||
} | ||
exports.setupConsoleLogger = setupConsoleLogger; | ||
function setupFileLogger(options) { | ||
options = options || {}; | ||
options.formatter = createFormatter(); | ||
@@ -45,0 +45,0 @@ options.json = false; |
{ | ||
"name": "modular-log", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Modular components based on Winston logger", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15365
2
245