mirror of
https://github.com/fosrl/newt.git
synced 2026-02-25 06:16:43 +00:00
Add logging to config
This commit is contained in:
@@ -6,6 +6,8 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
|
"github.com/fosrl/newt/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
func getConfigPath(clientType string) string {
|
func getConfigPath(clientType string) string {
|
||||||
@@ -34,6 +36,7 @@ func getConfigPath(clientType string) string {
|
|||||||
|
|
||||||
func (c *Client) loadConfig() error {
|
func (c *Client) loadConfig() error {
|
||||||
if c.config.ID != "" && c.config.Secret != "" && c.config.Endpoint != "" {
|
if c.config.ID != "" && c.config.Secret != "" && c.config.Endpoint != "" {
|
||||||
|
logger.Debug("Config already provided, skipping loading from file")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,6 +68,9 @@ func (c *Client) loadConfig() error {
|
|||||||
c.baseURL = config.Endpoint
|
c.baseURL = config.Endpoint
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.Debug("Loaded config from %s", configPath)
|
||||||
|
logger.Debug("Config: %+v", c.config)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user