X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcutil%2Fsilclog.c;h=5f770769103d9f085b6d5dca501ad511d4c6f3d2;hb=ab9186bc3211a1a940464d5dc9e660d2da3a1923;hp=4a70cbc5a7d47d0ba6a665f5dafd104d7efb3b5f;hpb=7c35ac27874b23204fd6bc4fb851085ba756c213;p=silc.git diff --git a/lib/silcutil/silclog.c b/lib/silcutil/silclog.c index 4a70cbc5..5f770769 100644 --- a/lib/silcutil/silclog.c +++ b/lib/silcutil/silclog.c @@ -49,6 +49,9 @@ static struct SilcLogStruct silclogs[SILC_LOG_MAX] = { {"", NULL, 0, "Fatal", SILC_LOG_FATAL, NULL, NULL}, }; +/* Causes logging output to contain timestamps */ +bool silc_log_timestamp = TRUE; + /* If TRUE, log files will be flushed for each log input */ bool silc_log_quick = FALSE; @@ -220,7 +223,12 @@ void silc_log_output(SilcLogType type, char *string) goto end; found: - fprintf(fp, "[%s] [%s] %s\n", silc_get_time(), typename, string); + /* writes the logging string to the selected channel */ + if (silc_log_timestamp) + fprintf(fp, "[%s] [%s] %s\n", silc_get_time(), typename, string); + else + fprintf(fp, "[%s] %s\n", typename, string); + if (silc_log_quick || silc_log_starting) { fflush(fp); if (log) /* we may have been redirected to stderr */