-
Notifications
You must be signed in to change notification settings - Fork 11
Logging Module
Hoie Kim edited this page Apr 23, 2020
·
10 revisions
Instead of your typical console.log
, we use a logging component.
-
Logging module is in
lib
folder. Importlib/log.js
Exmaple:
const logger = require('./lib/log')
-
Replace
console.log
tologger.info
.Exmaple:
logger.info('function has successfuly run')
-
You can apply different levels according to its importance.
Inportance Level Example 0 Error logger.error('an error has occured')
1 Warn `logger.warn('warning!') 2 Info `logger.info('function has successfuly run') 3 Verbose `logger.verbose('I don't even know what verbose means') 4 Debug `logger.debug('debug message') -
Output