]> git.giacomolli.uk - onechat/blobdiff - daemon_log.go
Order functions by their first use
[onechat] / daemon_log.go
index f1e4b0bf4ad0c4c111a9f1f4d3b63c71b99f00bf..771fef49a054a20d1761cd3aad2f1ef284f65c36 100644 (file)
@@ -104,18 +104,6 @@ func (h *DaemonLogHandler) WithGroup(name string) slog.Handler {
        return &clone
 }
 
        return &clone
 }
 
-// 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{},
-       })
-}
-
 // daemonLogAttr resolves and writes one attribute, or keeps its cause for the
 // end of the line. Groups flatten into dotted keys and empty attributes produce
 // no text.
 // daemonLogAttr resolves and writes one attribute, or keeps its cause for the
 // end of the line. Groups flatten into dotted keys and empty attributes produce
 // no text.
@@ -165,3 +153,15 @@ func durationText(d time.Duration) string {
 
        return d.Round(time.Second).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{},
+       })
+}