~jameinel/loggo/benchmarks

« back to all changes in this revision

Viewing changes to logger.go

  • Committer: Tim Penhey
  • Date: 2013-05-29 22:55:04 UTC
  • Revision ID: tim.penhey@canonical.com-20130529225504-dp9ngv6fpickacyp
Make ResetLogging public, and fix the implementation to be non-destructive.

Show diffs side-by-side

added added

removed removed

Lines of Context:
165
165
        }
166
166
}
167
167
 
 
168
// ResetLogging iterates through the known modules and sets the levels of all
 
169
// to NOT_SPECIFIED, except for <root> which is set to WARNING.
 
170
func ResetLogging() {
 
171
        modulesMutex.Lock()
 
172
        defer modulesMutex.Unlock()
 
173
        for _, module := range modules {
 
174
                module.level = NOT_SPECIFIED
 
175
        }
 
176
        root.level = WARNING
 
177
}
 
178
 
168
179
// GetLoggingLevel converts a string representation of a logging level to the
169
180
// enumerated value.
170
181
func GetLoggingLevel(level string) Level {