1.0.3 • Published 5 years ago

@beefoio/file.log v1.0.3

Weekly downloads
4
License
GPL-3.0
Repository
github
Last release
5 years ago

file.log

Log things, prefixed with a timestamp, to a file (./log/debug.log, ./log/datetime_logger.log)

Usage

var logger = require('@beefoio/file.log');

logger.enableConsoleOutput();
// enables printout to console

logger.setLevel('info');
// sets the level to info or higher

logger.info('an info');
// [07.10.2018 22:23:34] info: an info

API

logger.setLevel(level)

Set the Log-Level to the level and only things on that level or higher will get logged

logger.trace(msg...)

Logs the message in the format: dd.mm.YYYY HH:MM:ss trace: msg... to the files and optional to the console

logger.debug(msg...)

Logs the message in the format: dd.mm.YYYY HH:MM:ss debug: msg... to the files and optional to the console

logger.info(msg...)

Logs the message in the format: dd.mm.YYYY HH:MM:ss info: msg... to the files and optional to the console

logger.warn(msg...)

Logs the message in the format: dd.mm.YYYY HH:MM:ss warn: msg... to the files and optional to the console

logger.error(msg...)

Logs the message in the format: dd.mm.YYYY HH:MM:ss error: msg... to the files and optional to the console

logger.fatal(msg...)

Logs the message in the format: dd.mm.YYYY HH:MM:ss fatal: msg... to the files and optional to the console

License

GPL-3.0

1.0.3

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago