I know sails.log("some text")
replaces console.log
in SailsJS, but - How do I log things like info
, warn
and just normal text instead of error
in Sails 0.10x?
This information can all be found here: http://sailsjs.org/#/documentation/concepts/Logging
Essentially you can do sails.log()
, sails.warn()
, sails.error
, etc. and then specify which level of logs you want to see via the config/log.js
file.
Use sails.log['logLevel']
like sails.log.warn
or sails.log.error
Logs by order or precedence:
sails.log.error()
sails.log.warn()
sails.log.debug()
sails.log.info()
sails.log.verbose()
sails.log.silly()
by default sails log level config is sails.config.log.level = 'info'
then verbose and silly dont are displayed
More infos: http://sailsjs.org/#/documentation/concepts/Logging