repo.or.cz
/
rbx.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Added spec:commit task to commit changes to spec/ruby sources.
[rbx.git]
/
shotgun
/
lib
/
log.c
blob
5e999110ef9725dd8de2a85c4c1b41a05bbded0c
1
#include <stdio.h>
2
#include <stdlib.h>
3
#include <stdarg.h>
4
5
static int
debug_enabled
=
0
;
6
7
void
debug_enable
() {
8
debug_enabled
=
1
;
9
}
10
11
void
debug_disable
() {
12
debug_enabled
=
0
;
13
}
14
15
void
log_debug
(
const char
*
fmt
, ...) {
16
if
(!
debug_enabled
)
return
;
17
printf
(
"DEBUG: "
);
18
va_list
ap
;
19
va_start
(
ap
,
fmt
);
20
(
void
)
vprintf
(
fmt
,
ap
);
21
va_end
(
ap
);
22
return
;
23
}