Skip to content

Conversation

@mjmac
Copy link
Contributor

@mjmac mjmac commented Apr 1, 2019

Also updates DefaultLeveledLogger implementation to conform. Allows
a custom LoggerFactory to update a logger's loglevel at runtime.

@hugoArregui
Copy link
Member

Do we need it in the interface? Not sure how you end up implementing the factory but it seems to me that you could add it to the DefaultLeveledLogger but not to the interface.

@mjmac
Copy link
Contributor Author

mjmac commented Apr 1, 2019

Do we need it in the interface? Not sure how you end up implementing the factory but it seems to me that you could add it to the DefaultLeveledLogger but not to the interface.

I have to conform to the LoggerFactory interface in order to pass in my custom factory, and that interface definition uses the LeveledLogger interface:

type LoggerFactory interface {
NewLogger(scope string) LeveledLogger
}

Allows a custom LoggerFactory to update a logger's loglevel
at runtime.
@mjmac mjmac changed the title Add SetLevel() to LeveledLogger interface Add SetLevel() to DefaultLeveledLogger Apr 1, 2019
@Sean-Der Sean-Der merged commit fdbcd3a into pion:master Apr 2, 2019
@mjmac mjmac deleted the SetLevel branch April 2, 2019 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants