Skip to content

Commit

Permalink
log/log: log level setter and getter
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Jung <a.jung@lancs.ac.uk>
  • Loading branch information
nderjung committed Dec 20, 2020
1 parent f42d537 commit c420873
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,11 @@ func (l *Logger) log(level LogLevel, format string, messages ...interface{}) {
fmt.Printf("[%s] %s\n", out, fmt.Sprintf(format, messages...))
}
}

func SetLevel(level LogLevel) {
logger.LogLevel = level
}

func GetLevel() LogLevel {
return logger.LogLevel
}

0 comments on commit c420873

Please sign in to comment.