modular-log
Advanced tools
Comparing version 0.2.0 to 0.2.1
"use strict"; | ||
var log = require('../lib/index'); | ||
var Log = require('../lib/index'); | ||
// Create project level console log | ||
log.setupConsoleLogger({ | ||
Log.setupConsoleLogger({ | ||
level: 'trace', | ||
}); | ||
// Cretate project level file log | ||
log.setupFileLogger({ | ||
Log.setupFileLogger({ | ||
filename: 'outfile.log', | ||
level: 'warn', | ||
}); | ||
log.setupSummarizer({ | ||
Log.setupSummarizer({ | ||
level: 'warn', | ||
@@ -18,18 +18,19 @@ allowed: { fatal: 0 } | ||
// First logger object | ||
var logger = log.createLogger('App'); | ||
var logger = Log.createLogger('App'); | ||
logger.error('Testing', { cnt: cnt++ }); | ||
logger.warn('Testing', { cnt: cnt++ }); | ||
logger.success('Testing', { cnt: cnt++ }); | ||
logger.info('Testing', { cnt: cnt++ }); | ||
logger.debug('Testing', { cnt: cnt++ }); | ||
logger.trace('Testing', { cnt: cnt++ }); | ||
logger.trace('canContinue', log.canContinue()); | ||
logger.trace('canContinue', Log.canContinue()); | ||
// Preparing delayed log | ||
setTimeout(function () { | ||
logger.fatal('Testing', { cnt: cnt++ }); | ||
logger.warn('CanContinue', log.canContinue()); | ||
logger.warn('CanContinue', Log.canContinue()); | ||
}, 1000); | ||
// Second logger object | ||
var logger2 = log.createLogger('Another'); | ||
var logger2 = Log.createLogger('Another'); | ||
logger2.warn('Another guy here'); | ||
var sum = log.sumLog(); | ||
var sum = Log.sumLog(); | ||
logger2.debug('Sum without this message', sum); |
@@ -1,5 +0,5 @@ | ||
import * as log from '../lib/index'; | ||
import * as Log from '../lib/index'; | ||
// Create project level console log | ||
log.setupConsoleLogger({ | ||
Log.setupConsoleLogger({ | ||
level: 'trace', | ||
@@ -9,3 +9,3 @@ }); | ||
// Cretate project level file log | ||
log.setupFileLogger({ | ||
Log.setupFileLogger({ | ||
filename: 'outfile.log', | ||
@@ -15,3 +15,3 @@ level: 'warn', | ||
log.setupSummarizer({ | ||
Log.setupSummarizer({ | ||
level: 'warn', | ||
@@ -24,9 +24,10 @@ allowed: { fatal: 0 } | ||
// First logger object | ||
let logger = log.createLogger('App'); | ||
let logger = Log.createLogger('App'); | ||
logger.error('Testing', { cnt: cnt++ }); | ||
logger.warn('Testing', { cnt: cnt++ }); | ||
logger.success('Testing', { cnt: cnt++ }); | ||
logger.info('Testing', { cnt: cnt++ }); | ||
logger.debug('Testing', { cnt: cnt++ }); | ||
logger.trace('Testing', { cnt: cnt++ }); | ||
logger.trace('canContinue', log.canContinue()); | ||
logger.trace('canContinue', Log.canContinue()); | ||
@@ -36,9 +37,9 @@ // Preparing delayed log | ||
logger.fatal('Testing', { cnt: cnt++ }); | ||
logger.warn('CanContinue', log.canContinue()); | ||
logger.warn('CanContinue', Log.canContinue()); | ||
}, 1000); | ||
// Second logger object | ||
let logger2 = log.createLogger('Another'); | ||
let logger2 = Log.createLogger('Another'); | ||
logger2.warn('Another guy here'); | ||
let sum = log.sumLog(); | ||
let sum = Log.sumLog(); | ||
logger2.debug('Sum without this message', sum); |
@@ -13,9 +13,5 @@ { | ||
}, | ||
"filesGlob": [ | ||
"./*.ts", | ||
"../typings/main.d.ts" | ||
], | ||
"atom": { | ||
"rewriteTsconfig": false | ||
} | ||
"include": [ | ||
"./*.ts" | ||
] | ||
} |
import * as winston from 'winston'; | ||
import { SummarizerOptions } from './summarizer'; | ||
import { LogLevels } from './definitions.d'; | ||
export { LogLevels } from './definitions.d'; | ||
export declare type LogLevels = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace'; | ||
export interface Logger extends winston.LoggerInstance { | ||
@@ -6,0 +5,0 @@ fatal(msg: string, meta?: any, callback?: () => void): Logger; |
{ | ||
"name": "modular-log", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Modular components based on Winston logger", | ||
@@ -19,2 +19,6 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@types/lodash": "0.0.28", | ||
"@types/moment": "^2.11.28", | ||
"@types/node": "^4.0.30", | ||
"@types/winston": "0.0.27", | ||
"colors": "^1.1.2", | ||
@@ -21,0 +25,0 @@ "lodash": "^4.6.1", |
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
261
11804
8
+ Added@types/lodash@0.0.28
+ Added@types/moment@^2.11.28
+ Added@types/node@^4.0.30
+ Added@types/winston@0.0.27
+ Added@types/lodash@0.0.28(transitive)
+ Added@types/moment@2.13.0(transitive)
+ Added@types/node@4.0.484.9.5(transitive)
+ Added@types/winston@0.0.27(transitive)