Skip to content

Commit

Permalink
[pinpoint-apm#117] in time none configuration loading
Browse files Browse the repository at this point in the history
  • Loading branch information
feelform committed Oct 18, 2022
1 parent 166fba3 commit 692eb72
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/utils/log/logger2.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ class Logger {
return Logger.Builder(LogType.error)
}

static get NoneBuilder() {
return Logger.Builder(LogType.noneConfig)
}

debug(message) {
this.adaptor.debug(message)
}
Expand Down Expand Up @@ -85,6 +89,10 @@ class LogType {
return new LogType('error')
}

static get noneConfig() {
return new LogType('none')
}

constructor(name) {
this.name = name
}
Expand Down
3 changes: 3 additions & 0 deletions test/utils/log/logger.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,8 @@ test('Logger.Builder', (t) => {
t.equal(actual.type.name, 'error', 'error name match')
t.true(actual.adaptor === expectedAdaptor, 'adaptor member variable')

actual = new Logger.NoneBuilder(expectedAdaptor).build()
t.equal(actual.type.name, 'none', 'none name match')

t.end()
})

0 comments on commit 692eb72

Please sign in to comment.