forked from extern/endlessh
Route all logging through a function pointer
Prepare for a second logging function that logs to syslog.
This commit is contained in:
parent
e4f8c9f8f4
commit
5b7dc86a47
@ -57,8 +57,10 @@ static enum loglevel {
|
|||||||
log_debug
|
log_debug
|
||||||
} loglevel = log_none;
|
} loglevel = log_none;
|
||||||
|
|
||||||
|
static void (*logmsg)(enum loglevel level, const char *, ...);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
logmsg(enum loglevel level, const char *format, ...)
|
logstdio(enum loglevel level, const char *format, ...)
|
||||||
{
|
{
|
||||||
if (loglevel >= level) {
|
if (loglevel >= level) {
|
||||||
int save = errno;
|
int save = errno;
|
||||||
@ -605,6 +607,7 @@ sendline(struct client *client, int max_line_length, unsigned long *rng)
|
|||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
logmsg = logstdio;
|
||||||
struct config config = CONFIG_DEFAULT;
|
struct config config = CONFIG_DEFAULT;
|
||||||
const char *config_file = DEFAULT_CONFIG_FILE;
|
const char *config_file = DEFAULT_CONFIG_FILE;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user