Skip to content

Commit

Permalink
refactor: Reduce log verboseness
Browse files Browse the repository at this point in the history
Move the following logs to debug level:
- `Task broker is ready`
- `Launcher's runner ID: f9f15e9381262fbb`
- `Runner's task offer was accepted`

With info level, the following logs are printed:

```
2024/12/12 17:03:58 INFO  Starting launcher...
2024/12/12 17:03:58 INFO  Starting launcher's health check server at port 5680
2024/12/12 17:03:58 INFO  Waiting for task broker to be ready...
2024/12/12 17:05:03 INFO  Waiting for launcher's task offer to be accepted...
2024/12/12 17:05:15 DEBUG [Runner] Health check server listening on 127.0.0.1, port 5681
2024/12/12 17:05:30 DEBUG [Runner] Received IDLE_TIMEOUT signal, shutting down...
2024/12/12 17:05:30 DEBUG [Runner] Task runner stopped
2024/12/12 17:05:30 INFO  Runner exited on idle timeout
2024/12/12 17:05:30 INFO  Waiting for task broker to be ready...
2024/12/12 17:05:30 INFO  Waiting for launcher's task offer to be accepted...
```
  • Loading branch information
tomi committed Dec 12, 2024
1 parent 316bbfa commit 6efa612
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ CLI utility to launch an [n8n task runner](https://docs.n8n.io/PENDING) in `exte
2024/11/29 13:37:46 DEBUG Changed into working directory
2024/11/29 13:37:46 DEBUG Prepared env vars for runner
2024/11/29 13:37:46 INFO Waiting for task broker to be ready...
2024/11/29 13:37:46 INFO Task broker is ready
2024/11/29 13:37:46 DEBUG Task broker is ready
2024/11/29 13:37:46 DEBUG Fetched grant token for launcher
2024/11/29 13:37:46 INFO Launcher's runner ID: fc6c24b9f764ae55
2024/11/29 13:37:46 DEBUG Launcher's runner ID: fc6c24b9f764ae55
2024/11/29 13:37:46 DEBUG Connected: ws://127.0.0.1:5679/runners/_ws?id=fc6c24b9f764ae55
2024/11/29 13:37:46 DEBUG <- Received message `broker:inforequest`
2024/11/29 13:37:46 DEBUG -> Sent message `runner:info`
Expand Down
2 changes: 1 addition & 1 deletion internal/http/check_until_broker_ready.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func CheckUntilBrokerReady(taskBrokerURI string) error {
return err
}

logs.Info("Task broker is ready")
logs.Debug("Task broker is ready")

return nil
}
4 changes: 2 additions & 2 deletions internal/ws/handshake.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func Handshake(cfg HandshakeConfig) error {
}

runnerID := randomID()
logs.Infof("Launcher's runner ID: %s", runnerID)
logs.Debugf("Launcher's runner ID: %s", runnerID)

wsURL, err := buildWebsocketURL(cfg.TaskBrokerServerURI, runnerID)
if err != nil {
Expand Down Expand Up @@ -207,7 +207,7 @@ func Handshake(cfg HandshakeConfig) error {
wsConn.Close()
return err
case <-handshakeComplete:
logs.Info("Runner's task offer was accepted")
logs.Debug("Runner's task offer was accepted")
return nil
}
}

0 comments on commit 6efa612

Please sign in to comment.