We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c32766 commit a455aebCopy full SHA for a455aeb
src/week2/3-event-loop/logger.js
@@ -3,26 +3,20 @@
3
{
4
const INDENT_SPACES = 2;
5
6
- class Logger {
7
- constructor() {
8
- this.level = 0;
9
- }
10
-
+ window.logger = {
+ level: 0,
11
enter(name) {
12
const indentation = ' '.repeat(this.level * INDENT_SPACES);
13
console.log(`${indentation}entering ${name}`);
14
this.level += 1;
15
16
+ },
17
leave(name) {
18
this.level -= 1;
19
20
console.log(`${indentation}leaving ${name}`);
21
if (this.level === 0) {
22
console.log('-'.repeat(40));
23
}
24
25
26
27
- window.logger = new Logger();
+ };
28
0 commit comments