AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
6.75k stars 485 forks source link

Advanced logging settings #838

Open wrohdewald opened 11 months ago

wrohdewald commented 11 months ago

go2rtc 1.8.4 on raspbian bullseye

From /var/log/syslog:

Dec 20 13:38:31 cam-sw go2rtc[2100]: #033[90m13:38:31.528#033[0m #033[33mDBG#033[0m [rtsp] new consumer #033[36mstream=#033[0msw
wrohdewald commented 11 months ago

I forgot - the system time is also redundant

AlexxIT commented 11 months ago
log:
  format: text  # or json
wrohdewald commented 10 months ago

That is a functioning workaround, thank you.

I did actually not even try to find a workaround because IMHO it should not be necessary, those ESC sequences are only meant for terminals and should never go into log files no matter what settings the user defines. So far I only know about one single project doing that - and the fixed it a long time ago.

I do not know go, but in internal/app/log.go I see:

NoColor: format == "text"

How about something like

NoColor: output is streaming into file or maybe NoColor: writer is SyslogWriter

but then I do not see SyslogWriter in the source code and I have no idea under which circumstance syslog is written to.