diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2022-04-24 13:24:41 +0200 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2022-04-24 13:24:41 +0200 |
commit | fc50a7f6c9e45b0c4e2bb03fbfc42b70e23b9aa6 (patch) | |
tree | 06b2206059672a98ce7797e3e7359f5801e2f0b7 /src/log.c | |
parent | separated css and html, removed php-cli dependency (diff) | |
download | sear.c-fc50a7f6c9e45b0c4e2bb03fbfc42b70e23b9aa6.tar sear.c-fc50a7f6c9e45b0c4e2bb03fbfc42b70e23b9aa6.tar.gz sear.c-fc50a7f6c9e45b0c4e2bb03fbfc42b70e23b9aa6.tar.bz2 sear.c-fc50a7f6c9e45b0c4e2bb03fbfc42b70e23b9aa6.tar.lz sear.c-fc50a7f6c9e45b0c4e2bb03fbfc42b70e23b9aa6.tar.xz sear.c-fc50a7f6c9e45b0c4e2bb03fbfc42b70e23b9aa6.tar.zst sear.c-fc50a7f6c9e45b0c4e2bb03fbfc42b70e23b9aa6.zip |
Diffstat (limited to '')
-rw-r--r-- | src/log.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,6 @@ +#ifndef SC_LOGLEVEL +#define SC_LOGLEVEL "SC_LOG_ERROR SC_LOG_WARNING SC_LOG_INFO SC_LOG_DEBUG" +#endif const char * sc_log_str (SC_OPT_TYPE t) { switch (t & SC_LOG_MASK) { case SC_LOG_ERROR: @@ -24,9 +27,11 @@ struct sc_logentry * sc_logentry_init () { return l; } #endif -int sc_push_log (unsigned char t, struct sc_cache * c, const char * ca, char * f, size_t l, unsigned short int isf, char * m, ...) { +int sc_push_log (SC_OPT_TYPE t, struct sc_cache * c, const char * ca, char * f, size_t l, unsigned short int isf, char * m, ...) { #define SC_PLL c->logentries[c->logentries_length-1] char * compiled_message = NULL; + if (!strstr(getenv("SC_LOGLEVEL") ? getenv("SC_LOGLEVEL") : SC_LOGLEVEL, sc_log_str(t))) + return 0; #ifdef SC_LOGMEM if (!c) return -1; |