How to Log in SailsJS

前端 未结 2 1820
醉话见心
醉话见心 2021-02-13 04:57

What is the actual syntax to log in SailsJS?

Docs don\'t have anything, but found the following line in the site\'s roadmap

\"Pull out Sails.log (

2条回答
  •  无人共我
    2021-02-13 05:33

    In your controllers, models, services, and anywhere else that the sails global is available, you can log with one of:

    sails.log();
    sails.log.warn();
    sails.log.info();
    sails.log.debug();
    sails.log.error();
    sails.log.verbose();
    sails.log.silly();
    

    The logging level (that is, the level at which logs will be output to the console) is set in /config/log.js.

提交回复
热议问题