Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

modular-log

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

modular-log - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

examples/outfile.log

19

examples/basic-example.js
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc