plog icon indicating copy to clipboard operation
plog copied to clipboard

Can I change log Severity at runtime by the linux command kill ?

Open AlexYIN opened this issue 7 years ago • 2 comments

Can I change log Severity by the linux command kill at runtime?

Such as, the current log Severity is INFO, but I want to trace more information, so I need to change the log Severity to DEBUG with the kill command and without the program restart .

AlexYIN avatar Aug 02 '18 01:08 AlexYIN

Yes, you can but you need to write and register a signal handler (that will react on kill command).

void handle_signal(int signal)
{
    plog::get()->setMaxSeverity(plog::verbose);
}

SergiusTheBest avatar Aug 02 '18 09:08 SergiusTheBest

I suggest to take another look at asynchronous-signal safety for calls of member functions.

elfring avatar Aug 07 '18 09:08 elfring