X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=secnet.git;a=blobdiff_plain;f=log.c;h=f3b5cbde7a3dd1f611aff40b4ea4a74ebaf1e6e7;hp=6aced817eb0aa79cc868de3a1c60fdb16a6aa782;hb=49b56eafcd147185c28848a7c04e31a32c49a82e;hpb=9cb06c1c86f9a7f687f6e3ac5af05a5072ce16d9 diff --git a/log.c b/log.c index 6aced81..f3b5cbd 100644 --- a/log.c +++ b/log.c @@ -49,12 +49,7 @@ FORMAT(printf,2,0) static void vMessage(uint32_t class, const char *message, va_list args) { - if (system_log) { - /* Messages go to the system log interface */ - vslilog_part(system_log, class, message, args); - } else { - vMessageFallback(class,message,args); - } + vslilog_part(system_log, class, message, args); } void Message(uint32_t class, const char *message, ...) @@ -663,6 +658,16 @@ void log_from_fd(int fd, cstring_t prefix, struct log_if *log) prefix); } +static struct logfile startup_log; +void log_early_init(void) +{ + logfile_file_init(&startup_log,stderr,"startup"); + system_log=&startup_log.ops;; +} + +/* for the benefit of main, really */ +void logfile_init_file(struct logfile *st, FILE *f); + void log_module(dict_t *dict) { setlinebuf(stderr);