We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
as the title v4.10.2
func (l *defaultLogger) Logf(level Level, format string, v ...interface{}) { // TODO decide does we need to write message if log level not used? if !l.opts.Level.Enabled(level) { return } l.RLock() fields := copyFields(l.opts.Fields) l.RUnlock() fields["level"] = level.String() if _, file, line, ok := runtime.Caller(l.opts.CallerSkipCount); ok { fields["file"] = fmt.Sprintf("%s:%d", logCallerfilePath(file), line) } rec := dlog.Record{ Timestamp: time.Now(), Message: fmt.Sprintf(format, v...), Metadata: make(map[string]string, len(fields)), } keys := make([]string, 0, len(fields)) for k, v := range fields { keys = append(keys, k) rec.Metadata[k] = fmt.Sprintf("%v", v) } sort.Strings(keys) metadata := "" for _, k := range keys { metadata += fmt.Sprintf(" %s=%v", k, fields[k]) } dlog.DefaultLog.Write(rec) t := rec.Timestamp.Format("2006-01-02 15:04:05") fmt.Printf("%s %s %v\n", t, metadata, rec.Message) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
as the title
v4.10.2
The text was updated successfully, but these errors were encountered: