func (l *logWriter) LogWrite(rec *log4go.LogRecord) { p := Prof.Enter("log") defer p.Exit() l.lock.Lock() defer l.lock.Unlock() fl := log4go.FormatLogRecord(log4go.FORMAT_DEFAULT, rec) l.log <- fl }
func NewSysLogWriter(priority syslog.Priority) (w sysLogWriter, err error) { writer, err := connectSyslogDaemon(priority) if err != nil { return } w = sysLogWriter(make(chan *log.LogRecord, log.LogBufferLength)) go func() { defer func() { if w != nil { w.Close() } }() for rec := range w { m := log.FormatLogRecord("(%S) %M", rec) getWriter(writer, rec.Level.String())(m) } }() return }
func (m *myLogWriter) LogWrite(rec *log4go.LogRecord) { p := Prof.Enter("log") defer p.Exit() fl := log4go.FormatLogRecord(log4go.FORMAT_DEFAULT, rec) m.log <- fl }
func (t *testlogger) LogWrite(rec *log4go.LogRecord) { t.t.Log(strings.TrimSpace(log4go.FormatLogRecord(log4go.FORMAT_DEFAULT, rec))) }