rethinkdbdash icon indicating copy to clipboard operation
rethinkdbdash copied to clipboard

Optionally log errors

Open codermapuche opened this issue 7 years ago • 6 comments

Not all log are errors and it is useful to differentiate when something goes wrong when everything is ok

codermapuche avatar Sep 01 '17 13:09 codermapuche

Why isn't that useful? If you add a new server, you want to know whether a pool was created or not

neumino avatar Sep 03 '17 04:09 neumino

@neumino I'm confused, are you saying console.error is necessary to know if the pool was created? Why can't console.log work?

aleclarson avatar Sep 03 '17 13:09 aleclarson

@neumino when use rethinkdbdash in a child proccess, a console.error redirect messages to stderr, not to stdout, this is a ploblem, because the stderr can be used to dispatch an alert, log activity, trace execution and eventually restart the child process, i agree that log new pool connections is useful, but this is not an error, is a desired task. For this reason not removes the line of the log, only change the target of this message from stderror to stdout.

codermapuche avatar Sep 05 '17 23:09 codermapuche

Why can't stderr dispatch an alert? Isn't that an issue with your paging system? You can also just use the log event if you don't want everything to go to stderr.

If you want to change the core/default behavior, please submit a proposal to classify all messages in debug/info/warn/error. So far no one has proposed a clean API - feel free to reopen https://github.com/neumino/rethinkdbdash/issues/325 if you want

neumino avatar Sep 09 '17 17:09 neumino

I had started to spec out an API for this in https://github.com/neumino/rethinkdbdash/issues/334#issuecomment-293423825. That's probably a good starting point if anyone wants to submit a formal proposal.

marshall007 avatar Sep 11 '17 21:09 marshall007

Check out #355 as the follow-up to this PR. 😄

aleclarson avatar Sep 13 '17 01:09 aleclarson