mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-09 19:50:26 +03:00
New functions snac_debug() and snac_log().
This commit is contained in:
parent
32c188ae8f
commit
1ad66e5166
1
main.c
1
main.c
@ -14,6 +14,7 @@ int main(int argc, char *argv[])
|
||||
srv_open("/home/angel/lib/snac/comam.es");
|
||||
|
||||
snac_open(&snac, "mike");
|
||||
snac_log(&snac, xs_str_new("ok"));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
12
snac.c
12
snac.c
@ -199,3 +199,15 @@ void snac_free(snac *snac)
|
||||
free(snac->key);
|
||||
free(snac->actor);
|
||||
}
|
||||
|
||||
|
||||
void snac_debug(snac *snac, int level, d_char *str)
|
||||
/* prints a user debugging information */
|
||||
{
|
||||
xs *msg = str;
|
||||
|
||||
if (dbglevel >= level) {
|
||||
xs *tm = xs_local_time("%H:%M:%S");
|
||||
fprintf(stderr, "%s [%s] %s\n", tm, snac->uid, msg);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user