-
Notifications
You must be signed in to change notification settings - Fork 1
2.5 Lunar.Logger
Caio Vaccaro edited this page Apr 14, 2016
·
1 revision
Its purpose is to give additional insights during development. The Logger does not work in production mode. It have the following methods:
import Lunar from 'orbitjs'
const Logger = Lunar().Logger
Logger.getLevel()
Logger.setLevel()
Logger.log()This method returns a "string" of the current log level (eg. "OFF").
This method accepts a "string" and will update the log level accordingly. Available levels are:
- OFF: No logs will be displayed.
- FATAL: Only fatal errors will be displayed.
- ERROR: All kinds of errors.
- WARN: All of the above and warnings.
- ALL: Any kind of log will be displayed.
Accepts both "object" and an "array" of such, with a "message" and the "level" of it. The result is a regular "console.log" if the current "level" corresponds to the message level.