diff options
author | 2023-08-21 20:07:55 +0200 | |
---|---|---|
committer | 2023-08-21 19:07:55 +0100 | |
commit | 4ae16bce8c6aa8e3d96ca69015d2065badee3994 (patch) | |
tree | ebced804b50c4905e133d606b6416e0fce7b9f72 /internal/config/helpers.gen.go | |
parent | [performance] Tweak media attachment cleanup; replace stale index (#2143) (diff) | |
download | gotosocial-4ae16bce8c6aa8e3d96ca69015d2065badee3994.tar.xz |
[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>
Diffstat (limited to 'internal/config/helpers.gen.go')
-rw-r--r-- | internal/config/helpers.gen.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/internal/config/helpers.gen.go b/internal/config/helpers.gen.go index aed111129..ab7d38a8a 100644 --- a/internal/config/helpers.gen.go +++ b/internal/config/helpers.gen.go @@ -49,6 +49,31 @@ func GetLogLevel() string { return global.GetLogLevel() } // SetLogLevel safely sets the value for global configuration 'LogLevel' field func SetLogLevel(v string) { global.SetLogLevel(v) } +// GetLogTimestampFormat safely fetches the Configuration value for state's 'LogTimestampFormat' field +func (st *ConfigState) GetLogTimestampFormat() (v string) { + st.mutex.RLock() + v = st.config.LogTimestampFormat + st.mutex.RUnlock() + return +} + +// SetLogTimestampFormat safely sets the Configuration value for state's 'LogTimestampFormat' field +func (st *ConfigState) SetLogTimestampFormat(v string) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.LogTimestampFormat = v + st.reloadToViper() +} + +// LogTimestampFormatFlag returns the flag name for the 'LogTimestampFormat' field +func LogTimestampFormatFlag() string { return "log-timestamp-format" } + +// GetLogTimestampFormat safely fetches the value for global configuration 'LogTimestampFormat' field +func GetLogTimestampFormat() string { return global.GetLogTimestampFormat() } + +// SetLogTimestampFormat safely sets the value for global configuration 'LogTimestampFormat' field +func SetLogTimestampFormat(v string) { global.SetLogTimestampFormat(v) } + // GetLogDbQueries safely fetches the Configuration value for state's 'LogDbQueries' field func (st *ConfigState) GetLogDbQueries() (v bool) { st.mutex.RLock() |