mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-12 21:10:22 +03:00
Improved server debug functions.
This commit is contained in:
parent
91adc48178
commit
b1a1717fd9
10
snac.c
10
snac.c
@ -39,13 +39,15 @@ d_char *xs_time(char *fmt, int local)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void srv_log(d_char *str)
|
void srv_debug(int level, d_char *str)
|
||||||
/* logs a message */
|
/* logs a debug message */
|
||||||
{
|
{
|
||||||
xs *tm = xs_local_time("%H:%M:%S");
|
|
||||||
xs *msg = str;
|
xs *msg = str;
|
||||||
|
|
||||||
fprintf(stderr, "%s %s\n", tm, msg);
|
if (dbglevel >= level) {
|
||||||
|
xs *tm = xs_local_time("%H:%M:%S");
|
||||||
|
fprintf(stderr, "%s %s\n", tm, msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
4
snac.h
4
snac.h
@ -11,6 +11,8 @@ d_char *xs_time(char *fmt, int local);
|
|||||||
#define xs_local_time(fmt) xs_time(fmt, 1)
|
#define xs_local_time(fmt) xs_time(fmt, 1)
|
||||||
#define xs_utc_time(fmt) xs_time(fmt, 0)
|
#define xs_utc_time(fmt) xs_time(fmt, 0)
|
||||||
|
|
||||||
void srv_log(d_char *str);
|
void srv_debug(int level, d_char *str);
|
||||||
|
#define srv_log(str) srv_debug(0, str)
|
||||||
|
|
||||||
int srv_open(char *basedir);
|
int srv_open(char *basedir);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user