Skip to content

Commit

Permalink
Pull request: add log writer
Browse files Browse the repository at this point in the history
Merge in DNS/golibs from add-log-writer to master

Updates AdguardTeam/AdGuardHome#2273.

Squashed commit of the following:

commit 5e9ca32
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri Nov 13 15:28:44 2020 +0300

    log: fix comment

commit 2319364
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri Nov 13 15:16:21 2020 +0300

    log: add writer returner
  • Loading branch information
EugeneOne1 committed Nov 13, 2020
1 parent 3f698cd commit ee52d33
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ func (t *Timer) LogElapsed(message string, args ...interface{}) {
writeLog(level, f.Name(), buf.String(), args...)
}

// Writer returns the output destination for the default logger.
func Writer() io.Writer {
return log.Writer()
}

// SetLevel sets logging level
func SetLevel(level int) {
logLevel = level
Expand Down

0 comments on commit ee52d33

Please sign in to comment.