loglevel bitmasks needs to be larger because we got more than 32 files

This commit is contained in:
Michael Stapelberg 2010-04-17 17:46:11 +02:00
parent b93413ca49
commit 7f3a77ac6a
3 changed files with 5 additions and 5 deletions

View File

@ -21,7 +21,7 @@ endif
# Depend on the specific file (.c for each .o) and on all headers # Depend on the specific file (.c for each .o) and on all headers
src/%.o: src/%.c ${HEADERS} src/%.o: src/%.c ${HEADERS}
echo "CC $<" 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} all: src/cfgparse.y.o src/cfgparse.yy.o src/cmdparse.y.o src/cmdparse.yy.o ${FILES}
echo "LINK i3" echo "LINK i3"

View File

@ -41,7 +41,7 @@ void set_verbosity(bool _verbose);
* but only if the corresponding debug loglevel was activated. * 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. * Logs the given message to stdout while prefixing the current time to it.

View File

@ -21,7 +21,7 @@
/* loglevels.h is autogenerated at make time */ /* loglevels.h is autogenerated at make time */
#include "loglevels.h" #include "loglevels.h"
static uint32_t loglevel = 0; static uint64_t loglevel = 0;
static bool verbose = true; static bool verbose = true;
/** /**
@ -41,7 +41,7 @@ void set_verbosity(bool _verbose) {
void add_loglevel(const char *level) { void add_loglevel(const char *level) {
/* Handle the special loglevel "all" */ /* Handle the special loglevel "all" */
if (strcasecmp(level, "all") == 0) { if (strcasecmp(level, "all") == 0) {
loglevel = UINT32_MAX; loglevel = UINT64_MAX;
return; return;
} }
@ -109,7 +109,7 @@ void errorlog(char *fmt, ...) {
* This is to be called by DLOG() which includes filename/linenumber * 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; va_list args;
if ((loglevel & lev) == 0) if ((loglevel & lev) == 0)