UNPKG

3.74 kBJavaScriptView Raw
1/**
2 * @class APIBuilder.Logger
3 * The API Builder Logger class provides a logging utility. You can access
4 * a local instance of the log utility using the `logger` property of the API Builder
5 * instance.
6 */
7
8/**
9 * @method createLogger
10 * Creates a log utility instance.
11 * @static
12 * @param {Object} config - Additional initialization options.
13 * @return {APIBuilder.Logger}
14 */
15/**
16 * @method createDefaultLogger
17 * @alias #static-method-createLogger
18 * @static
19 * @param {Object} config - Additional initialization options.
20 * @deprecated since version 4.0
21 * @return {APIBuilder.Logger}
22 */
23/**
24 * @method createRestifyLogger
25 * Creates a restify version of the log utility.
26 * @static
27 * @deprecated since version 4.0
28 * @param {APIBuilder} apibuilder - API Builder instance.
29 * @param {Object} config - Additional initialization options.
30 * @return {APIBuilder.Logger}
31 */
32/**
33 * @method debug
34 * Logs a message with a debug-level severity.
35 * @param {...Object} [params] String, formatted-string with variables, object or Error object.
36 * @return {Boolean/void} If no arguments are passed, returns a boolean indicating if the debug
37 * level is enabled.
38 */
39/**
40 * @method error
41 * Logs a message with an error-level severity.
42 * @param {...Object} [params] String, formatted-string with variables, object or Error object.
43 * @return {Boolean/void} If no arguments are passed, returns a boolean indicating if the error
44 * level is enabled.
45 */
46/**
47 * @method fatal
48 * Logs a message with a fatal-level severity.
49 * @param {...Object} [params] String, formatted-string with variables, object or Error object.
50 * @return {Boolean/void} If no arguments are passed, returns a boolean indicating if the fatal
51 * level is enabled.
52 */
53/**
54 * @method info
55 * Logs a message with an info-level severity.
56 * @param {...Object} [params] String, formatted-string with variables, object or Error object.
57 * @return {Boolean/void} If no arguments are passed, returns a boolean indicating if the info
58 * level is enabled.
59 */
60/**
61 * @method level
62 * Sets or retrieves the log level.
63 * @param {Number/String} [level] Level to set.
64 */
65/**
66 * @method levels
67 * Sets or retrieves the log level for a specific stream.
68 * @param {Number/String} [stream] Stream to set or retrieve the log level for.
69 * @param {Number/String} [level] Level to set.
70 * @return {Array<Number>/Number/void} If no arguments are passed, retrieves an array of available
71 * log levels. If the stream is passed, retrieves the current log level of the stream.
72 */
73/**
74 * @method stripColors
75 * Removes ANSI color codes from the string
76 * @deprecated
77 * @param {String} string
78 * @return {String}
79 */
80/**
81 * @method trace
82 * Logs a message with a trace-level severity.
83 * @param {...Object} [params] String, formatted-string with variables, object or Error object.
84 * @return {Boolean/void} If no arguments are passed, returns a boolean indicating if the trace
85 * level is enabled.
86 */
87/**
88 * @method warn
89 * Logs a message with a warn-level severity.
90 * @param {...Object} [params] String, formatted-string with variables, object or Error object.
91 * @return {Boolean/void} If no arguments are passed, returns a boolean indicating if the warn
92 * level is enabled.
93 */
94
95/**
96 * @property {Number} DEBUG
97 * Constant indicating the debug level
98 * @static
99 */
100/**
101 * @property {Number} ERROR
102 * Constant indicating the error level
103 * @static
104 */
105/**
106 * @property {Number} FATAL
107 * Constant indicating the fatal level
108 * @static
109 */
110/**
111 * @property {Number} INFO
112 * Constant indicating the info level
113 * @static
114 */
115/**
116 * @property {Number} TRACE
117 * Constant indicating the trace level
118 * @static
119 */
120/**
121 * @property {Number} WARN
122 * Constant indicating the warn level
123 * @static
124 */