|
@@ -1,6 +1,7 @@
|
|
|
package config
|
|
package config
|
|
|
|
|
|
|
|
import (
|
|
import (
|
|
|
|
|
+ "log/slog"
|
|
|
"os"
|
|
"os"
|
|
|
"path/filepath"
|
|
"path/filepath"
|
|
|
"time"
|
|
"time"
|
|
@@ -47,6 +48,7 @@ func defaultConfig() *Config {
|
|
|
func Load() (*Config, error) {
|
|
func Load() (*Config, error) {
|
|
|
path, err := os.UserConfigDir()
|
|
path, err := os.UserConfigDir()
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
|
|
+ slog.Info("user configuration directory path cannot be determined; falling back to the current directory path")
|
|
|
path = "."
|
|
path = "."
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -55,6 +57,7 @@ func Load() (*Config, error) {
|
|
|
|
|
|
|
|
cfg := defaultConfig()
|
|
cfg := defaultConfig()
|
|
|
if os.IsNotExist(err) {
|
|
if os.IsNotExist(err) {
|
|
|
|
|
+ slog.Info("the configuration file does not exist, falling back to the default configuration", "path", path, "err", err)
|
|
|
return cfg, nil
|
|
return cfg, nil
|
|
|
}
|
|
}
|
|
|
|
|
|