mirror of
https://github.com/0intro/libtask
synced 2024-12-22 11:12:35 +03:00
enable debugging functions when taskdebuglevel is set
This commit is contained in:
parent
b0c00d19fb
commit
0d454584f8
11
task.c
11
task.c
@ -31,11 +31,12 @@ taskdebug(char *fmt, ...)
|
||||
char *p;
|
||||
static int fd = -1;
|
||||
|
||||
return;
|
||||
if(taskdebuglevel == 0)
|
||||
return;
|
||||
|
||||
va_start(arg, fmt);
|
||||
vfprint(1, fmt, arg);
|
||||
va_end(arg);
|
||||
return;
|
||||
|
||||
if(fd < 0){
|
||||
p = strrchr(argv0, '/');
|
||||
@ -278,6 +279,9 @@ taskname(char *fmt, ...)
|
||||
va_list arg;
|
||||
Task *t;
|
||||
|
||||
if(taskdebuglevel == 0)
|
||||
return;
|
||||
|
||||
t = taskrunning;
|
||||
va_start(arg, fmt);
|
||||
vsnprint(t->name, sizeof t->name, fmt, arg);
|
||||
@ -296,6 +300,9 @@ taskstate(char *fmt, ...)
|
||||
va_list arg;
|
||||
Task *t;
|
||||
|
||||
if(taskdebuglevel == 0)
|
||||
return;
|
||||
|
||||
t = taskrunning;
|
||||
va_start(arg, fmt);
|
||||
vsnprint(t->state, sizeof t->name, fmt, arg);
|
||||
|
Loading…
Reference in New Issue
Block a user