Manager: improve "loading configuration" log message

Raise the log level from DEBUG to INFO, as it's quite important to be
explicit about which configuration file is loaded. Also ensure that the
file path is made absolute, so that it's again more explicit.
This commit is contained in:
Sybren A. Stüvel 2025-07-15 10:54:47 +02:00
parent 7e40e1bbb0
commit 0000619f67

View File

@ -182,7 +182,17 @@ func DefaultConfig(override ...func(c *Conf)) Conf {
// loadConf parses the given file and returns its contents as a Conf object. // loadConf parses the given file and returns its contents as a Conf object.
func loadConf(filename string, overrides ...func(c *Conf)) (Conf, error) { func loadConf(filename string, overrides ...func(c *Conf)) (Conf, error) {
log.Debug().Str("file", filename).Msg("loading configuration") // Make sure the rest of the logging uses an absolute path, to help
// disambiguate things and simplify debugging.
if !filepath.IsAbs(filename) {
var err error
filename, err = filepath.Abs(filename)
if err != nil {
return Conf{}, fmt.Errorf("making configuration file path absolute: %w", err)
}
}
log.Info().Str("file", filename).Msg("loading configuration")
yamlFile, err := os.ReadFile(filename) yamlFile, err := os.ReadFile(filename)
if err != nil { if err != nil {
var evt *zerolog.Event var evt *zerolog.Event