-
Notifications
You must be signed in to change notification settings - Fork 1
/
theme-test.js
145 lines (127 loc) · 3.41 KB
/
theme-test.js
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
'use strict';
const Logger = require('./');
const log = new Logger();
const err = new Error(`Cannot think of a good error text, so i'm writing this sentence!`);
err.code = 'E_ACCESS';
err.name = 'RangeError';
err.errno = 23423;
const callsite = {
lineNumber: 3425,
fileName: __filename,
type: 'Object',
function: 'section.test',
method: 'cb',
date: new Date(),
};
const aLongFunction = (some, paramters = {}) => {
// the comment is of no use,
const butTheVariable = 'is!';
for (const char of butTheVariable.values()) {
console.log(char);
}
};
log.log({
callsite,
values: [
err,
new Map([['key', {
values: [1,2,3]
}], [1, 123], ['thisIsSo', 'a cool looger!']]),
new Set([1,2,3]),
null,
undefined,
{aProperty:{someOtherProperty: ['this is a string', true]}},
true,
new Date(),
() => {return 1;},
aLongFunction,
435435,
Symbol(234234),
/does this match?/gim,
new Promise((r) => {r()}),
new WeakSet(),
new WeakMap(),
Buffer.alloc(100, 'a'),
[{
id: 34532,
title: 'Best Party ever!',
startDate: new Date(),
endDate: new Date(),
price: 25.60,
deleted: null,
venue: {
name: 'Joinbox',
floor: 'HQ',
address: 'Brückfeldstarsse 16',
zip: 3012,
city: 'Bern',
country: 'Switzerland'
},
image: Buffer.alloc(256),
canceled: false,
category: 'concert',
author: undefined,
genres: [
'minimal',
'dubstep',
],
}, {
id: 34532,
title: 'Best Party ever!',
startDate: new Date(),
endDate: new Date(),
price: 25.60,
deleted: null,
venue: {
name: 'Joinbox',
floor: 'HQ',
address: 'Brückfeldstarsse 16',
zip: 3012,
city: 'Bern',
country: 'Switzerland'
},
image: Buffer.alloc(5673),
canceled: false,
category: 'concert',
author: undefined,
genres: [
'minimal',
'dubstep',
],
}]
]
});
log.log({
values: ['This value is invalid: NaN!'],
color: 'green.bold',
callsite: Object.assign({}, callsite, {lineNumber: 4}),
});
log.log({
values: [`I don't think this should happen!`],
color: 'yellow.bold',
callsite,
});
log.log({
values: [`This is critical!`],
color: 'red.bold',
callsite,
});
log.log({
values: [err],
color: 'red',
callsite,
});
log.log({
values: [`a pretty long string that should be trunctaed, but does it? I'm not sure, or am i? i am! So, i'm still in the airplane and someone keep sfarting. Thanks obama!`],
color: 'red.bold',
callsite,
});
log.log({
values: [`a pretty long string that should be trunctaed, but does it? I'm not sure, or am i? i am! So, i'm still in the airplane and someone keeps farting. Thanks obama! this one gets rendered!`],
color: 'cyan.bold.strikethrough.underline.bgBlue',
callsite,
moduleName: 'my-module',
options: {
truncate: 1000
}
});