sat icon indicating copy to clipboard operation
sat copied to clipboard

[Sat embedded]: a line of logs is triggered by `sat.New()` with `traceProvider == nil`

Open k33g opened this issue 2 years ago • 2 comments

With Sat embedded, the sat.New() function triggers a line of log even if the traceProvider parameter equals nil:

{"log_message":"(W) configured to use HTTP with no TLS","timestamp":"2022-06-05T11:47:03.328707564Z","level":2,"app":{"sat_version":"v0.1.4"}}

k33g avatar Jun 05 '22 17:06 k33g

@k33g would you like something like a -q|quiet mode flag that silences standard output on sat completely, or is it this particular line that you would like to not be logged? Just trying to understand the motivation.

flaki avatar Jul 28 '22 15:07 flaki

@flaki If I use Sat as usual (serving a runnable), I don't mind. But if I use Sat as a library to develop my own CLI, I want to be able to manage the output as I want. For example, If I code a CLI that returns me a list of restaurants for a given town, I only wish to the list of restaurants (without a log trace)

So, about the server mode, I would say that a -q|quiet flag is perfect, but about the embedded way, I need complete control over what I want to display. Then I would like to be able to do it from the code, because I will probably handle my own flags and messages.

k33g avatar Jul 29 '22 11:07 k33g