console
console module
Console access object
Global object. Can be used for notification, alert and error log. By starting config file, the log can be located to different devices for easy tracking.
Static Function
log
Save normal log indo, same as info
1 | console.log(fmt,...args); |
Parameter Usage:
- fmt: String, Format string
- args: …, Optional parameter list
Example:
1 | exports.hi = v => { |
Save normal level log info. Typically used to output none error information
Save normal log indo, same as info
1 | console.log(...args); |
Parameter Usage:
- args: …, Optional parameter list
1 | exports.hi = v => { |
Save normal level log info. Typically used to output none error information
debug
Save debug log
1 | console.debug(fmt,...args); |
Parameter Usage:
- fmt: String, Format string
- args: …, Optional parameter list
1 | exports.hi = v => { |
Save debug log。Typically used to output debug info. not important.
Save debug log
1 | console.debug(...args); |
Parameter Usage:
- args: …, Optional parameter list
1 | exports.hi = v => { |
Save debug log。Typically used to output debug info. not important.
info
Record normal log info, same as log
1 | console.info(fmt,...args); |
Parameter Usage:
- fmt: String, Format string
- args: …, Optional parameter list
1 | exports.hi = v => { |
Save normal level log info. Typically used to output none error information
Record normal log info, same as log
1 | console.info(...args); |
Parameter Usage:
- args: …, Optional parameter list
1 | exports.hi = v => { |
Save normal level log info. Typically used to output none error information
notice
Record alert log info
1 | console.notice(fmt,...args); |
Parameter Usage:
- fmt: String, Format string
- args: …, Optional parameter list
1 | exports.hi = v => { |
Record alert log info. Typically used to output informative debug info, normal important
Record alert log info
1 | console.notice(...args); |
Parameter Usage:
- args: …, Optional parameter list
1 | exports.hi = v => { |
Record alert log info. Typically used to output informative debug info, normal important
warn
Record alert log info
1 | console.warn(fmt,...args); |
Parameter Usage:
- fmt: String, Format string
- args: …, Optional parameter list
1 | exports.hi = v => { |
Record alert log info. Typically used to output warning debug info, important
Record alert log info
1 | console.warn(...args); |
Parameter Usage:
- args: …, Optional parameter list
1 | exports.hi = v => { |
Record alert log info. Typically used to output warning debug info, important
error
Record error log info
1 | console.error(fmt,...args); |
Parameter Usage:
- fmt: String, Format string
- args: …, Optional parameter list
1 | exports.hi = v => { |
Used to record error log info. Typically used to output error log, very important. System error messages are also recorded at this level.
Record error log info
1 | console.error(...args); |
Parameter Usage:
- args: …, Optional parameter list
1 | exports.hi = v => { |
Used to record error log info. Typically used to output error log, very important. System error messages are also recorded at this level.
crit
Record key error log info
1 | console.crit(fmt,...args); |
Parameter Usage:
- fmt: String, Format string
- args: …, Optional parameter list
1 | exports.hi = v => { |
Used to record key error log info. Typically used to output key error log, very important.
Record key error log info
1 | console.crit(...args); |
Parameter Usage:
- args: …, Optional parameter list
1 | exports.hi = v => { |
Used to record key error log info. Typically used to output key error log, very important.
alert
Record alert error log info
1 | console.alert(fmt,...args); |
Parameter Usage:
- fmt: String, Format string
- args: …, Optional parameter list
1 | exports.hi = v => { |
Used to record warning error log info. Typically used to output warning error log, very important. The highest level of information
Record alert error log info
1 | console.alert(...args); |
Parameter Usage:
- args: …, Optional parameter list
1 | exports.hi = v => { |
Used to record warning error log info. Typically used to output warning error log, very important. The highest level of information
dir
Output object using JSON format
1 | console.dir(obj); |
Parameter Usage:
- obj: Value, Define the object to show.
1 | exports.hi = v => { |
trace
Output the current calling stack
1 | console.trace(label); |
Parameter Usage:
- label: String, title,default is an empty string.
Prints the current call stack via log.
assert
Assertion test, if the test value is false, an error is reported
1 | console.assert(value,msg); |
Parameter Usage:
- value: Value, Value to test
- msg: String, error message
Constant
FATAL
loglevel level constant
1 | const console.FATAL = 0; |
ALERT
loglevel level constant
1 | const console.ALERT = 1; |
CRIT
loglevel level constant
1 | const console.CRIT = 2; |
ERROR
loglevel level constant
1 | const console.ERROR = 3; |
WARN
loglevel level constant
1 | const console.WARN = 4; |
NOTICE
loglevel level constant
1 | const console.NOTICE = 5; |
INFO
loglevel level constant
1 | const console.INFO = 6; |
DEBUG
loglevel level constant
1 | const console.DEBUG = 7; |
loglevel For output only, information output does not break lines, file and syslog do not save this level of information
1 | const console.PRINT = 9; |
NOTSET
loglevel level constant
1 | const console.NOTSET = 10; |
