blob: 8127492ae0beba81daf9a6c3dd75e012c3f2e72a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
|
# TOC
- [test/cologne.js](#testcolognejs)
- [test/utilities.js](#testutilitiesjs)
- [test/formatters/simple.js](#testformatterssimplejs)
- [test/formatters/token.js](#testformatterstokenjs)
- [test/loggers/file.js](#testloggersfilejs)
- [test/loggers/console.js](#testloggersconsolejs)
<a name="testcolognejs"></a>
# test/cologne.js
#log() should send every argument to the loggers.
#log() should send the same arguments to all the loggers.
#log() should send all objects in cologne log format.
#log() should default to level 6.
#debug() should set to level 7.
#info() should set to level 6.
#notice() should set to level 5.
#warn() should set to level 4.
#error() should set to level 3.
#buildLog() should return a cologne log.
#buildLog() should default to level 6.
#buildLog() should use the specified level.
#buildLog() should use the message property as the message if available.
#buildLog() should extend the object with its properties.
#log() calls using a pre-built cologne log should maintain the log level.
#removeLogger() should do nothing if it can't find a logger.
#removeLogger() should remove a logger.
#removeLogger() should no longer affect removed logs.
#addLogger() should add loggers after instance is live.
ok - test/cologne.js
<a name="testutilitiesjs"></a>
# test/utilities.js
::now() should give a precise bigint timestamp.
::stringify() should behave like JSON.stringify for non-circular objects.
::stringify() should replace circular references with a string.
::stringify() should convert bigint to string.
::getAnsiCode is sending the correct reset code.
::getAnsiCode() should give us a reset code if something weird is sent.
::getAnsiCode() should not have duplicated non-reset codes.
::getAnsiCode() should not return a reset code in any other supported code.
::gettLevelAnsi is red for emerg.
::gettLevelAnsi is red for alert.
::gettLevelAnsi is red for crit.
::gettLevelAnsi is red for error.
::gettLevelAnsi is yellow for warn.
::gettLevelAnsi is blue for notice.
::gettLevelAnsi is blue for info.
::gettLevelAnsi is green for debug.
::gettLevelAnsi is default for other values.
ok - test/utilities.js
<a name="testformatterssimplejs"></a>
# test/formatters/simple.js
#format() should output a string in plain mode.
#format() should include the from property in plain mode.
#format() should include the timestamp property in iso format in plain mode.
#format() should include the level string property in plain mode.
#format() should include the message property in plain mode.
#format() should output a string in color mode.
#format() should include the from property in color mode.
#format() should include the timestamp property in iso format in color mode.
#format() should include the level string property in color mode.
#format() should include the message property in color mode.
#format() should colorize the string.
#format() should colorize only a bit of the string.
ok - test/formatters/simple.js
<a name="testformatterstokenjs"></a>
# test/formatters/token.js
#format() should output a string in default mode.
#format() should include the message in default mode.
#format() should output a string in custom mode.
#format() with custom string should include the specified tokens (check 1).
#format() with custom string should include the specified tokens (check 2).
#format() with iso date should include the timestamp as an iso date.
#format() should not replace tokens that don't match.
#format() should output a string in ansi mode.
#format() with ansi tokens should colorize the string.
#format() with ansi reset should reset the string.
#format() with ansi tokens should colorize the string based on level.
#format() should output a string in plain date mode.
#format() with plain date should include the timestamp as-is.
#format() should output a string in custom search mode.
#format() with a custom search, should properly match the new tokens.
ok - test/formatters/token.js
<a name="testloggersfilejs"></a>
# test/loggers/file.js
raw file.
formatted file.
it should send all params to the file.
it should log the raw json object.
it should send all params to the file.
it should log the formatted object.
ok - test/loggers/file.js
<a name="testloggersconsolejs"></a>
# test/loggers/console.js
It should default to the global console.
It should send debug messages to console's #log.
It should send info and notice messages to console's #info.
It should send warn messages to console's #warn.
It should send error messages to console's #error.
If available, it should send the objects to the formatter.
ok - test/loggers/console.js
----------------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
----------------|----------|----------|----------|----------|-------------------|
All files | 100 | 100 | 100 | 100 | |
lib | 100 | 100 | 100 | 100 | |
cologne.js | 100 | 100 | 100 | 100 | |
utilities.js | 100 | 100 | 100 | 100 | |
lib/formatters | 100 | 100 | 100 | 100 | |
simple.js | 100 | 100 | 100 | 100 | |
token.js | 100 | 100 | 100 | 100 | |
lib/loggers | 100 | 100 | 100 | 100 | |
console.js | 100 | 100 | 100 | 100 | |
file.js | 100 | 100 | 100 | 100 | |
----------------|----------|----------|----------|----------|-------------------|
|