Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Flush ¶
func Flush()
Flush calls the functions registered through OnFlush() and waits for them.
Programs that use servenv.Run*() will invoke Flush() automatically at shutdown. Other programs should defer logutil.Flush() at the beginning of main().
Concurrent calls to Flush are serialized.
func GetSubprocessFlags ¶
func GetSubprocessFlags() []string
GetSubprocessFlags returns the list of flags to use to have subprocesses log in the same directory as the current process.
Types ¶
type ThrottledLogger ¶
type ThrottledLogger struct {
// contains filtered or unexported fields
}
ThrottledLogger will allow logging of messages but won't spam the logs.
func NewThrottledLogger ¶
func NewThrottledLogger(name string, maxInterval time.Duration) *ThrottledLogger
NewThrottledLogger will create a ThrottledLogger with the given name and throttling interval.
func (*ThrottledLogger) Errorf ¶
func (tl *ThrottledLogger) Errorf(format string, v ...interface{})
Errorf logs an error if not throttled.
func (*ThrottledLogger) Infof ¶
func (tl *ThrottledLogger) Infof(format string, v ...interface{})
Infof logs an info if not throttled.
func (*ThrottledLogger) Warningf ¶
func (tl *ThrottledLogger) Warningf(format string, v ...interface{})
Warningf logs a warning if not throttled.