mirror of
https://github.com/skeeto/endlessh.git
synced 2025-12-08 14:13:23 +00:00
Route all logging through a function pointer
Prepare for a second logging function that logs to syslog.
This commit is contained in:
@@ -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;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user