Currently, the "Hello World" does alway appear in the journal. How can I prevent this, e.g. have it only in the journal, if debug is 1?
int main(int argc, char *argv[]) {
int debug = (argc >= 2 && !strcmp(argv[1], "--debug")) ? 1 : 0;
/* must only appear in the journal, if debug == 1 */
sd_journal_print(LOG_DEBUG, "Hello World");
return 0;
}
I'm on a ressource limited system and cannot afford too much logging.
Thanks in advance!
Addition: I'm asking for an equivalent to Pythons logging.Logger.setLevel
(https://docs.python.org/3/library/logging.html#logging.Logger.setLevel).