+// daemonLogger returns the logger of the part of the daemon with prefix, such
+// as "telegram: ", on out. The journal adds the time to each line and sets
+// JOURNAL_STREAM for a service, so then the lines have no time stamp. Otherwise
+// each line has the standard time stamp.
+func daemonLogger(out io.Writer, prefix string) *log.Logger {
+ if os.Getenv("JOURNAL_STREAM") != "" {
+ return log.New(out, prefix, 0)
+ }
+
+ return log.New(out, prefix, log.LstdFlags)
+}
+