Skip to content

Remove config methods from Logger  #12

@jlenon7

Description

@jlenon7

Description

addConfig, removeConfig and resetConfig could be a little confusing and not so performative because it creates new instances of the Driver every time one of this methods are called.

A better way to handle it is just using the Logger constructor:

const runtimeConfigs = {
  bucket: 'test',
}

const logger = new Logger(runtimeConfigs)

Or channel method:

const runtimeConfigs = {
  filePath: 'test.log',
}

const logger = new Logger()

logger.channel('file', runtimeConfigs)

Both implementation are useful, because you can remove/reset the runtimeConfig in Logger using channel method, this way you don't need to create a new instance of Logger.

Package version

1.2.6

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationrefactorRefactor a past featuretestAdding missing tests or correcting existing tests

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions