1.4.0 • Published 8 months ago

streamlogs v1.4.0

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

Streamlogs.js

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

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

Using default logger (that pipes to console)

const { defLog } = require("streamlogs")

defLog.info("Hello world!", "user")

New logger pipes into standard output

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

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

You can also use ECMAscript

import { defLog } from "streamlogs"

defLog.info("Hello world!", "user")
1.4.0

8 months ago

1.3.0

11 months ago

1.2.0

12 months ago

1.1.0

1 year ago

1.0.0

2 years ago