voipmonitor / sniffer

VoIPmonitor sniffer sources
226 stars 105 forks source link

Logging: stdout/stderr and system journal #82

Open kvishnivetsky opened 2 years ago

kvishnivetsky commented 2 years ago

Hi!

There is part of debug output as syslog calls and part as std::cout. syslog - it's Ok Why std::cout ?

milon21 commented 2 years ago

The sensor have parameter -k for running foreground. In this case std::cout is used.

kvishnivetsky commented 2 years ago

So, this is "by design" or it was a "fast way" to do some debugging output in C++ manner (streams)? ;-)

milon21 commented 2 years ago

Hello, can you point to some piece of code you don't like ? Thanks.

kvishnivetsky commented 2 years ago

Hello, can you point to some piece of code you don't like ? Thanks.

Ok. Idea is in using universal logging: "syslog everywhere" or "cout/cerr everywhere" but too. Or make debug output to cout/cerr depending from "-k" presence.

Problem is that, when I run voipmonitor as a service I see only part of out in system journal, and to see all I need to run in foreground mode. BTW I need to restart service to use "debug mode".

milon21 commented 2 years ago

I forgot to mention that sensor makes many conversion/preparation processes for the GUI as a simple binary and there the cout is in the place. (So it's not only -k parameter) But if you find a place which should be syslogged instead of cout then please let us to know. Thanks.