From 308c656f05d0609eeb02891dbe3c30f8b0438765 Mon Sep 17 00:00:00 2001 From: Jeroen Wijenbergh Date: Tue, 2 Sep 2025 14:48:49 +0200 Subject: All: Get rid of debug arg in Register --- client/client.go | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'client/client.go') diff --git a/client/client.go b/client/client.go index 69664e2..5317907 100644 --- a/client/client.go +++ b/client/client.go @@ -61,9 +61,6 @@ type Client struct { // The fsm FSM fsm.FSM - // Whether to enable debugging - Debug bool - // TokenSetter sets the tokens in the client TokenSetter func(sid string, stype srvtypes.Type, tok srvtypes.Tokens) @@ -143,7 +140,7 @@ func (c *Client) goTransition(id fsm.StateID) error { // - debug: whether or not we want to enable debugging // // It returns an error if initialization failed, for example when discovery cannot be obtained and when there are no servers. -func New(name string, version string, directory string, stateCallback func(FSMStateID, FSMStateID, any) bool, debug bool) (c *Client, err error) { +func New(name string, version string, directory string, stateCallback func(FSMStateID, FSMStateID, any) bool) (c *Client, err error) { // We create the client by filling fields one by one c = &Client{} @@ -155,13 +152,7 @@ func New(name string, version string, directory string, stateCallback func(FSMSt return nil, i18nerr.NewInternalf("The client registered with an invalid version: '%v'", version) } - // Initialize the logger - lvl := slog.LevelInfo - if debug { - lvl = slog.LevelDebug - } - - logr, err := log.Init(lvl, directory) + logr, err := log.Init(slog.LevelDebug, directory) if err != nil { return nil, i18nerr.WrapInternalf(err, "The log file with directory: '%s' failed to initialize", directory) } @@ -176,9 +167,6 @@ func New(name string, version string, directory string, stateCallback func(FSMSt // Initialize the FSM c.FSM = newFSM(stateCallback) - // Debug only if given - c.Debug = debug - c.cfg = config.NewFromDirectory(directory) // set the servers -- cgit v1.2.3