X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/790279faf0fda789d93a75f6f5996e65d5de4a18..d8f3785bb69288663f4cc46bf4d609c6770452d5:/daemon_log.go diff --git a/daemon_log.go b/daemon_log.go index ef1360c..771fef4 100644 --- a/daemon_log.go +++ b/daemon_log.go @@ -11,18 +11,6 @@ import ( "time" ) -// daemonLogger returns a logger for one daemon part. JOURNAL_STREAM selects -// syslog priorities without a time stamp. Other output carries the standard -// time stamp and level. -func daemonLogger(out io.Writer, prefix string) *slog.Logger { - return slog.New(&DaemonLogHandler{ - out: out, - prefix: prefix, - journal: os.Getenv("JOURNAL_STREAM") != "", - mutex: &sync.Mutex{}, - }) -} - // DaemonLogHandler writes short event lines with ordered attributes. Copies // share the writer lock. The err attribute follows all other attributes as a // cause. Journal lines carry a syslog priority instead of a time and level. @@ -165,3 +153,15 @@ func durationText(d time.Duration) string { return d.Round(time.Second).String() } + +// daemonLogger returns a logger for one daemon part. JOURNAL_STREAM selects +// syslog priorities without a time stamp. Other output carries the standard +// time stamp and level. +func daemonLogger(out io.Writer, prefix string) *slog.Logger { + return slog.New(&DaemonLogHandler{ + out: out, + prefix: prefix, + journal: os.Getenv("JOURNAL_STREAM") != "", + mutex: &sync.Mutex{}, + }) +}