loglevel bitmasks needs to be larger because we got more than 32 files
This commit is contained in:
parent
b93413ca49
commit
7f3a77ac6a
2
Makefile
2
Makefile
|
@ -21,7 +21,7 @@ endif
|
|||
# Depend on the specific file (.c for each .o) and on all headers
|
||||
src/%.o: src/%.c ${HEADERS}
|
||||
echo "CC $<"
|
||||
$(CC) $(CFLAGS) -DLOGLEVEL="(1 << $(shell awk '/$(shell basename $< .c)/ { print NR }' loglevels.tmp))" -c -o $@ $<
|
||||
$(CC) $(CFLAGS) -DLOGLEVEL="((uint64_t)1 << $(shell awk '/$(shell basename $< .c)/ { print NR }' loglevels.tmp))" -c -o $@ $<
|
||||
|
||||
all: src/cfgparse.y.o src/cfgparse.yy.o src/cmdparse.y.o src/cmdparse.yy.o ${FILES}
|
||||
echo "LINK i3"
|
||||
|
|
|
@ -41,7 +41,7 @@ void set_verbosity(bool _verbose);
|
|||
* but only if the corresponding debug loglevel was activated.
|
||||
*
|
||||
*/
|
||||
void debuglog(int lev, char *fmt, ...);
|
||||
void debuglog(uint64_t lev, char *fmt, ...);
|
||||
|
||||
/**
|
||||
* Logs the given message to stdout while prefixing the current time to it.
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
/* loglevels.h is autogenerated at make time */
|
||||
#include "loglevels.h"
|
||||
|
||||
static uint32_t loglevel = 0;
|
||||
static uint64_t loglevel = 0;
|
||||
static bool verbose = true;
|
||||
|
||||
/**
|
||||
|
@ -41,7 +41,7 @@ void set_verbosity(bool _verbose) {
|
|||
void add_loglevel(const char *level) {
|
||||
/* Handle the special loglevel "all" */
|
||||
if (strcasecmp(level, "all") == 0) {
|
||||
loglevel = UINT32_MAX;
|
||||
loglevel = UINT64_MAX;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,7 @@ void errorlog(char *fmt, ...) {
|
|||
* This is to be called by DLOG() which includes filename/linenumber
|
||||
*
|
||||
*/
|
||||
void debuglog(int lev, char *fmt, ...) {
|
||||
void debuglog(uint64_t lev, char *fmt, ...) {
|
||||
va_list args;
|
||||
|
||||
if ((loglevel & lev) == 0)
|
||||
|
|
Loading…
Reference in New Issue