1.1.0 • Published 5 months ago

streamlogs v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Streamlogs.js

  • Manages logs by using node.js streams and events.
  • levels: trace, debug, info, warn, error, fatal

Objects

ObjectDescription
basicLoggerReadable stream sending logs in .log style. Support for colors
JSONloggerSame as basicLogger, but in JSON format
defLogDefault instance of basicLogger, pipes into stdout, can be shared between modules
logLevelenum of log levels

Examples

New logger pipes into console

const logger = require("streamlogs")
const log = new logger.basicLogger()
log.pipe(process.stdout)

log.addLog("Hello world!", logger.logLevel.info, "user")