mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 05:15:04 +00:00
Improved server debug functions.
This commit is contained in:
parent
91adc48178
commit
b1a1717fd9
2 changed files with 9 additions and 5 deletions
10
snac.c
10
snac.c
|
@ -39,13 +39,15 @@ d_char *xs_time(char *fmt, int local)
|
|||
}
|
||||
|
||||
|
||||
void srv_log(d_char *str)
|
||||
/* logs a message */
|
||||
void srv_debug(int level, d_char *str)
|
||||
/* logs a debug message */
|
||||
{
|
||||
xs *tm = xs_local_time("%H:%M:%S");
|
||||
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_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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue