Skip to content

Commit

Permalink
moved SetTimeout under Logger
Browse files Browse the repository at this point in the history
  • Loading branch information
xm1k3 committed Jan 3, 2023
1 parent 7255efd commit 4730dc8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gologger.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ func (l *Logger) SetWriter(writer writer.Writer) {
l.writer = writer
}

// SetTimestamp sets a global flag indicating whether or not to add timestamps to debug logs.
// If the flag is set to true, timestamps will be added to debug logs.
func SetTimestamp(timestamp bool) {
DefaultLogger.addTimestamp = timestamp
}

// Event is a log event to be written with data
type Event struct {
logger *Logger
Expand Down Expand Up @@ -311,6 +305,12 @@ func (l *Logger) Verbose() *Event {
return event
}

// SetTimestamp sets a global flag indicating whether or not to add timestamps to debug logs.
// If the flag is set to true, timestamps will be added to debug logs.
func (l *Logger) SetTimestamp(timestamp bool) {
DefaultLogger.addTimestamp = timestamp
}

func isCurrentLevelEnabled(e *Event) bool {
return e.level <= e.logger.maxLevel
}

0 comments on commit 4730dc8

Please sign in to comment.