Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.
Gentilhomme edited this page May 4, 2017 · 1 revision

Logger

Little class to log message to the NodeJS terminal and to a local file. This class use stream.

Constructor

const logger = new nodeuim.Logger({
    file: 'checkconfig.log',
    level: 5
});

Constants

Logger.Critical // 0
Logger.Error // 1
Logger.Warning // 2
Logger.Info // 3
Logger.Debug // 4
Logger.Empty // 5

API

open()

Open log (when it was closed). Automatically called in the constructor.

close()

Close the log (The stream).

log(level,message)

Log a new message

logger.log(3,"Hello world!");

critical(message)

error(message)

warning(message)

info(message)

debug(message)

nohead(message)

Same as log but method name is explicit for the level.

dump(object)

Dump a JavaScript object.