[关闭]
@WrRan 2016-11-09T18:11:52.000000Z 字数 1313 阅读 911

sails

logger (Core Hook)

Status

Stability: 0 - Deprecated

This hook will almost certainly be merged into core (see FAQ below).

Dependencies

In order for this hook to load, the following other hooks must have already finished loading:

Dependents

If this hook is disabled, in order for Sails to load, the following other core hooks must also be disabled:

N/A

Purpose

This hook's responsibilities are:

Set up CaptainsLog

Instantiate a CaptainsLog logger instance.

Expose sails.log function

Publicly expose sails.log() function (see http://sailsjs.org/documentation/concepts/logging)

Add sails.log.ship() method

Add an extra method to the logger which teaches it how to draw a ship in ASCII.

Implicit Defaults

This hook sets the following implicit default configuration on sails.config:

Property Type Default
sails.config.log.level ((string)) 'info'

Events

hook:logger:loaded

Emitted when this hook has been automatically loaded by Sails core, and triggered the callback in its initialize function.

FAQ

If you have a question that isn't covered here, please feel free to send a PR adding it to this section (even if you don't have the answer!)

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注