diff --git a/common/log.c b/common/log.c index c65f428c..06d38eae 100644 --- a/common/log.c +++ b/common/log.c @@ -80,6 +80,17 @@ logprint_locked__(const char *fmt, ...) va_end(args); } +void logprint_silent(const char *fmt, ...) +{ + va_list args; + + ThreadLock(); + va_start(args, fmt); + vfprintf(logfile, fmt, args); + va_end(args); + ThreadUnlock(); +} + void logprint(const char *fmt, ...) { diff --git a/include/common/log.h b/include/common/log.h index bdd65ae0..0f11f633 100644 --- a/include/common/log.h +++ b/include/common/log.h @@ -31,8 +31,16 @@ void init_log(const char *filename); void close_log(); -void logprint(const char *fmt, ...) __attribute__((format(printf,1,2))); -void logvprint(const char *fmt, va_list args) __attribute__((format(printf,1,0))); + +/* Print to screen and to log file */ +void logprint(const char *fmt, ...) + __attribute__((format(printf,1,2))); +void logvprint(const char *fmt, va_list args) + __attribute__((format(printf,1,0))); + +/* Print only into log file */ +void logprint_silent(const char *fmt, ...) + __attribute__((format(printf,1,2))); /* Only called from the threads code */ void logprint_locked__(const char *fmt, ...)