* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: log.c,v 1.45 2007-01-03 08:42:15 adam Exp $
+ * $Id: log.c,v 1.47 2007-02-20 09:39:17 adam Exp $
*/
/**
#ifdef WIN32
DWORD tid = GetCurrentThreadId();
#else
- long tid = 0;
+ pthread_t tid = 0;
#if YAZ_POSIX_THREADS
tid = pthread_self();
#endif
level &= ~mask_names[i].mask;
}
}
-
- if (l_level & YLOG_NOTIME)
- tbuf[0] = '\0';
- else
- yaz_strftime(tbuf, TIMEFORMAT_LEN-1, l_actual_format, tm);
- tbuf[TIMEFORMAT_LEN-1] = '\0';
-
- fprintf(file, "%s %s%s %s%s\n", tbuf, l_prefix, flags, l_prefix2,
+
+ tbuf[0] = '\0';
+ if (!(l_level & YLOG_NOTIME))
+ {
+ yaz_strftime(tbuf, TIMEFORMAT_LEN-2, l_actual_format, tm);
+ tbuf[TIMEFORMAT_LEN-2] = '\0';
+ }
+ if (tbuf[0])
+ strcat(tbuf, " ");
+ fprintf(file, "%s%s%s %s%s\n", tbuf, l_prefix, flags, l_prefix2,
log_message);
if (l_level & YLOG_FLUSH)
fflush(file);