Closed gnosis23 closed 5 years ago
多用些基础库,少造轮子
warning Similar to Facebook's (FB) invariant but only logs a warning if the condition is not met. This can be used to log issues in development environments in critical paths.
warning
invariant 如名字所示,在关键地方提供个条件,来让
invariant
invariant(condition, '抛出异常如果条件错误');
debug 可以配合环境变量 DEBUG 来开启部分输出
debug
DEBUG
var debug = require('debug')('http') debug('booting %o', name);
多用些基础库,少造轮子
warning
Similar to Facebook's (FB) invariant but only logs a warning if the condition is not met. This can be used to log issues in development environments in critical paths.invariant
如名字所示,在关键地方提供个条件,来让debug
可以配合环境变量DEBUG
来开启部分输出