mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-15 05:13:01 -06:00
[feature] Make log format configurable (#2130)
* [feature] Don't emit timestamp in log lines When running gotosocial with a service manager like systemd, or a container runtime, the associated log driver usually emits timestamps itself. In those cases, having the extra timestamp from our own log lines ends up being a bit noisy and when centrally ingesting logs is duplicate information. This introduces a configuration flag that allows disabling emitting the timestamp. It's only wired up for "daemonised" processes, meaning server and testrig. * [chore] Add docs for log-timestamp * [feature] Simplify timestamp handling Co-Authored-By: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> * [chore] Less escaped double-quotes * [chore] Fix help string --------- Co-authored-by: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>
This commit is contained in:
parent
638f023a1c
commit
4ae16bce8c
12 changed files with 128 additions and 47 deletions
|
|
@ -26,6 +26,7 @@ import (
|
|||
|
||||
// InitTestLog sets the global logger to trace level for logging
|
||||
func InitTestLog() {
|
||||
log.SetTimeFormat(config.GetLogTimestampFormat())
|
||||
// Set the global log level from configuration
|
||||
if err := log.ParseLevel(config.GetLogLevel()); err != nil {
|
||||
log.Panicf(nil, "error parsing log level: %v", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue