mirror of
https://codeberg.org/cunicu/cunicu.git
synced 2025-09-26 21:01:14 +08:00
docs: Document new logging settings
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
@@ -181,6 +181,9 @@ func setupLogging(cfg *config.Config) error {
|
||||
|
||||
if cfg != nil {
|
||||
rules = append(rules, cfg.Log.Rules...)
|
||||
if cfg.Log.Level != "" {
|
||||
rules = append(rules, cfg.Log.Level)
|
||||
}
|
||||
}
|
||||
|
||||
if len(rules) == 0 {
|
||||
|
@@ -27,6 +27,54 @@ rpc:
|
||||
wait: false
|
||||
|
||||
|
||||
# Logging configuration
|
||||
log:
|
||||
# Show a banner during start of daemon
|
||||
banner: true
|
||||
|
||||
# Use one of
|
||||
# - auto only colorize log output on TTYs
|
||||
# - never never colorize log output
|
||||
# - always always colorize log output
|
||||
color: auto
|
||||
|
||||
# A path to a custom log file
|
||||
file: mylogfile.log
|
||||
|
||||
# The standard log level
|
||||
level: info
|
||||
|
||||
# Additional logging rules
|
||||
# Rule syntax:
|
||||
#
|
||||
# RULE: LEVELS:NAMESPACES
|
||||
#
|
||||
# LEVELS: LEVEL[,LEVELS]
|
||||
# LEVEL: one of
|
||||
# - SEVERITY for matching all levels with equal or higher severity
|
||||
# - >SEVERITY for matching all levels with higher severity
|
||||
# - =SEVERITY for matching all levels with equal severity
|
||||
# - <SEVERITY for matching all levels with lower severity
|
||||
#
|
||||
# SEVERITY: one of
|
||||
# - debug10..debug1
|
||||
# - debug
|
||||
# - info
|
||||
# - warn
|
||||
# - error
|
||||
# - fatal
|
||||
# - panic
|
||||
#
|
||||
# NAMESPACES: NAMESPACE[,NAMESPACES]
|
||||
# NAMESPACE: one of
|
||||
# - namespace should be exactly this namespace
|
||||
# - *mat*ch* should match
|
||||
# - -NAMESPACE should not match a namespace
|
||||
rules:
|
||||
- debug5:watcher,daemon
|
||||
- debug6:epdisc.*
|
||||
|
||||
|
||||
#### Interface settings start here
|
||||
# The following settings can be overwritten for each interface
|
||||
# using the 'interfaces' settings (see below).
|
||||
|
@@ -75,6 +75,7 @@ func (s *ICESettings) HasNetworkType(nt ice.NetworkType) bool {
|
||||
}
|
||||
|
||||
type LogSettings struct {
|
||||
Level string `koanf:"level,omitempty"`
|
||||
Rules []string `koanf:"rules,omitempty"`
|
||||
File string `koanf:"file,omitempty"`
|
||||
Color string `koanf:"color,omitempty"`
|
||||
|
@@ -193,7 +193,7 @@ func ParseRules(rules []string) (FilterFunc, error) {
|
||||
// - LEVELS
|
||||
// LEVELS: LEVEL[,LEVELS]
|
||||
// LEVEL: see `Level Patterns`
|
||||
// NAMESPACES: NAMESPACE[,NAMESPACE]
|
||||
// NAMESPACES: NAMESPACE[,NAMESPACES]
|
||||
// NAMESPACE: one of:
|
||||
// - namespace // Should be exactly this namespace
|
||||
// - *mat*ch* // Should match
|
||||
|
Reference in New Issue
Block a user