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

dev-logger

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dev-logger

A logger utility can be easily swiched between dev development and production mode. This tool supports: * built-in log rotation; * colorized log message; * 4 log levels and custom log level output; * caching log messages

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
Maintainers
1
Weekly downloads
 
Created
Source

dev-logger

A logger utility can be easily swiched between dev development and production mode. This tool supports:

  • built-in log rotation
  • colorized log message
  • 4 log levels and custom log level output
  • caching log messages

Install

Install the module with:

npm install dev-logger

Usage

var logger = require('dev-logger');
logger.log("normal log message")
logger.warn("warning message")
logger.error(bad error  message")
logger.info("success message")

// output realtime message
logger.isDebug = true

// output cached log message in an interval and turn on log rotation
logger.isDebug = false

// custom log level,  logger.LOG < logger.INFO < logger.WARN  < logger.ERROR
logger.setLevel(logger.INFO);

// custom log output path
logger.setPath(pathToLogFile);

// sample log messages:
// [9087] 2013-10-05T20:27:34.803Z LOG - [json_util::getJsonFromFile] path:/Users/ty/workspaces/runway/assets/json/missions.json
// [9087] 2013-10-05T20:27:34.803Z WARNING - [mission_asset::loadDepot]: load mission json data is NULL.
// [9087] 2013-10-05T20:27:34.803Z LOG - [json_util::getJsonFromFile] path:/Users/ty/workspaces/runway/assets/json/game_levels.json
// [9087] 2013-10-05T20:27:34.804Z LOG - [json_util::getJsonFromFile] path:/Users/ty/workspaces/runway/assets/json/monsters.json
// [9087] 2013-10-05T20:27:34.812Z INFO - [db.connectToMySQL] MySQL client is ready.



Contributing

mostly written by @wuyuntao

License

Copyright (c) 2013 yi Licensed under the MIT license.

Keywords

FAQs

Package last updated on 02 Jan 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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