ldaphotos/sources/include/log.h
Sandy Mossgrave 39a69c947e Quicksaving before first run on coldspringsharbor.
Added manipulations.c, which turns an array of bytes
into their hex representation.

Added a completely useless test suite.

Added manifesto.tex, which is, well, a dramatic name
for my notes to self and plan.

Added local.schema, which will be used by LDAP later on when
actually registering the photos in a database.
2023-06-19 08:56:49 +00:00

31 lines
739 B
C

#ifndef LDAP_LOG
#define LDAP_LOG
extern int run_verbose;
const char * currtime(void);
/*
Great, I remember why I chose to use a macro.
There's no good paradigm for passing the variadic arguments of printf
through another function.
I can use a paradigm wherein you just call the timestamper immediately
before printf()-ing your message, but like,
I dunno.
Let's see whether I can split the log(X) macro into this and a
function in log.h that supplies the time
*/
#ifdef USE_SYSLOG
#include <syslog.h>
#define log(Y, ...) syslog(Y, __VA_ARGS__)
#endif
#ifndef USE_SYSLOG
#define log(Y, ...) fprintf(stderr, "%s %s", currtime(), __VA_ARGS__)
#endif
#define verb(...) if(run_verbose)log(LOG_DEBUG, __VA_ARGS__)
#endif