1 /* Copyright (c) 2001, Matej Pfajfar.
2 * Copyright (c) 2001-2004, Roger Dingledine.
3 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
4 * Copyright (c) 2007-2008, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
7 const char log_c_id
[] = "$Id$";
11 * \brief Functions to send messages to log files or the console.
20 #ifdef HAVE_SYS_TIME_H
29 #ifdef HAVE_SYS_TYPES_H
30 #include <sys/types.h>
39 #include "container.h"
43 #define TRUNCATED_STR "[...truncated]"
44 #define TRUNCATED_STR_LEN 14
46 /** Information for a single logfile; only used in log.c */
47 typedef struct logfile_t
{
48 struct logfile_t
*next
; /**< Next logfile_t in the linked list. */
49 char *filename
; /**< Filename to open. */
50 int fd
; /**< fd to receive log messages, or -1 for none. */
51 int seems_dead
; /**< Boolean: true if the stream seems to be kaput. */
52 int needs_close
; /**< Boolean: true if the stream gets closed on shutdown. */
53 int is_temporary
; /**< Boolean: close after initializing logging subsystem.*/
54 int is_syslog
; /**< Boolean: send messages to syslog. */
55 log_callback callback
; /**< If not NULL, send messages to this function. */
56 log_severity_list_t
*severities
; /**< Which severity of messages should we
57 * log for each log domain? */
60 static void log_free(logfile_t
*victim
);
62 /** Helper: map a log severity to descriptive string. */
63 static INLINE
const char *
64 sev_to_string(int severity
)
67 case LOG_DEBUG
: return "debug";
68 case LOG_INFO
: return "info";
69 case LOG_NOTICE
: return "notice";
70 case LOG_WARN
: return "warn";
71 case LOG_ERR
: return "err";
72 default: /* Call assert, not tor_assert, since tor_assert
73 * calls log on failure. */
74 assert(0); return "UNKNOWN";
78 /** Helper: decide whether to include the function name in the log message. */
80 should_log_function_name(log_domain_mask_t domain
, int severity
)
85 /* All debugging messages occur in interesting places. */
90 /* We care about places where bugs occur. */
91 return (domain
== LD_BUG
);
93 /* Call assert, not tor_assert, since tor_assert calls log on failure. */
101 /** A mutex to guard changes to logfiles and logging. */
102 static tor_mutex_t
*log_mutex
= NULL
;
104 /** Linked list of logfile_t. */
105 static logfile_t
*logfiles
= NULL
;
107 static int syslog_count
= 0;
111 #define LOCK_LOGS() STMT_BEGIN \
112 tor_mutex_acquire(log_mutex); \
114 #define UNLOCK_LOGS() STMT_BEGIN tor_mutex_release(log_mutex); STMT_END
116 #define LOCK_LOGS() STMT_NIL
117 #define UNLOCK_LOGS() STMT_NIL
120 /* What's the lowest log level anybody cares about? */
121 int _log_global_min_severity
= LOG_NOTICE
;
123 static void delete_log(logfile_t
*victim
);
124 static void close_log(logfile_t
*victim
);
126 /** Name of the application: used to generate the message we write at the
127 * start of each new log. */
128 static char *appname
= NULL
;
130 /** Set the "application name" for the logs to <b>name</b>: we'll use this
131 * name in the message we write when starting up, and at the start of each new
134 * Tor uses this string to write the version number to the log file. */
136 log_set_application_name(const char *name
)
139 appname
= name
? tor_strdup(name
) : NULL
;
142 /** Helper: Write the standard prefix for log lines to a
143 * <b>buf_len</b> character buffer in <b>buf</b>.
146 _log_prefix(char *buf
, size_t buf_len
, int severity
)
154 tor_gettimeofday(&now
);
155 t
= (time_t)now
.tv_sec
;
157 n
= strftime(buf
, buf_len
, "%b %d %H:%M:%S", tor_localtime_r(&t
, &tm
));
158 r
= tor_snprintf(buf
+n
, buf_len
-n
, ".%.3ld [%s] ",
159 (long)now
.tv_usec
/ 1000, sev_to_string(severity
));
166 /** If lf refers to an actual file that we have just opened, and the file
167 * contains no data, log an "opening new logfile" message at the top.
169 * Return -1 if the log is broken and needs to be deleted, else return 0.
172 log_tor_version(logfile_t
*lf
, int reset
)
178 if (!lf
->needs_close
)
179 /* If it doesn't get closed, it isn't really a file. */
181 if (lf
->is_temporary
)
182 /* If it's temporary, it isn't really a file. */
185 is_new
= lf
->fd
>= 0 && tor_fd_getpos(lf
->fd
) == 0;
187 if (reset
&& !is_new
)
188 /* We are resetting, but we aren't at the start of the file; no
189 * need to log again. */
191 n
= _log_prefix(buf
, sizeof(buf
), LOG_NOTICE
);
193 tor_snprintf(buf
+n
, sizeof(buf
)-n
,
194 "%s opening %slog file.\n", appname
, is_new
?"new ":"");
196 tor_snprintf(buf
+n
, sizeof(buf
)-n
,
197 "Tor %s opening %slog file.\n", VERSION
, is_new
?"new ":"");
199 if (write_all(lf
->fd
, buf
, strlen(buf
), 0) < 0) /* error */
200 return -1; /* failed */
204 /** Helper: Format a log message into a fixed-sized buffer. (This is
205 * factored out of <b>logv</b> so that we never format a message more
206 * than once.) Return a pointer to the first character of the message
207 * portion of the formatted string.
210 format_msg(char *buf
, size_t buf_len
,
211 log_domain_mask_t domain
, int severity
, const char *funcname
,
212 const char *format
, va_list ap
, size_t *msg_len_out
)
218 assert(buf_len
>= 2); /* prevent integer underflow */
219 buf_len
-= 2; /* subtract 2 characters so we have room for \n\0 */
221 n
= _log_prefix(buf
, buf_len
, severity
);
222 end_of_prefix
= buf
+n
;
224 if (funcname
&& should_log_function_name(domain
, severity
)) {
225 r
= tor_snprintf(buf
+n
, buf_len
-n
, "%s(): ", funcname
);
232 if (domain
== LD_BUG
&& buf_len
-n
> 6) {
233 memcpy(buf
+n
, "Bug: ", 6);
237 r
= tor_vsnprintf(buf
+n
,buf_len
-n
,format
,ap
);
239 /* The message was too long; overwrite the end of the buffer with
240 * "[...truncated]" */
241 if (buf_len
>= TRUNCATED_STR_LEN
) {
242 size_t offset
= buf_len
-TRUNCATED_STR_LEN
;
243 /* We have an extra 2 characters after buf_len to hold the \n\0,
244 * so it's safe to add 1 to the size here. */
245 strlcpy(buf
+offset
, TRUNCATED_STR
, buf_len
-offset
+1);
247 /* Set 'n' to the end of the buffer, where we'll be writing \n\0.
248 * Since we already subtracted 2 from buf_len, this is safe.*/
256 return end_of_prefix
;
259 /** Helper: sends a message to the appropriate logfiles, at loglevel
260 * <b>severity</b>. If provided, <b>funcname</b> is prepended to the
261 * message. The actual message is derived as from tor_snprintf(format,ap).
264 logv(int severity
, log_domain_mask_t domain
, const char *funcname
,
265 const char *format
, va_list ap
)
271 char *end_of_prefix
=NULL
;
273 /* Call assert, not tor_assert, since tor_assert calls log on failure. */
275 /* check that severity is sane. Overrunning the masks array leads to
276 * interesting and hard to diagnose effects */
277 assert(severity
>= LOG_ERR
&& severity
<= LOG_DEBUG
);
281 if (! (lf
->severities
->masks
[SEVERITY_MASK_IDX(severity
)] & domain
)) {
285 if (! (lf
->fd
>= 0 || lf
->is_syslog
|| lf
->callback
)) {
289 if (lf
->seems_dead
) {
296 format_msg(buf
, sizeof(buf
), domain
, severity
, funcname
, format
, ap
,
302 /* XXXX Some syslog implementations have scary limits on the length of
303 * what you can pass them. Can/should we detect this? */
304 syslog(severity
, "%s", end_of_prefix
);
308 } else if (lf
->callback
) {
309 lf
->callback(severity
, domain
, end_of_prefix
);
313 if (write_all(lf
->fd
, buf
, msg_len
, 0) < 0) { /* error */
314 /* don't log the error! mark this log entry to be blown away, and
323 /** Output a message to the log. */
325 _log(int severity
, log_domain_mask_t domain
, const char *format
, ...)
328 if (severity
> _log_global_min_severity
)
331 logv(severity
, domain
, NULL
, format
, ap
);
335 /** Output a message to the log, prefixed with a function name <b>fn</b>. */
338 _log_fn(int severity
, log_domain_mask_t domain
, const char *fn
,
339 const char *format
, ...)
342 if (severity
> _log_global_min_severity
)
345 logv(severity
, domain
, fn
, format
, ap
);
349 const char *_log_fn_function_name
=NULL
;
351 _log_fn(int severity
, log_domain_mask_t domain
, const char *format
, ...)
354 if (severity
> _log_global_min_severity
)
357 logv(severity
, domain
, _log_fn_function_name
, format
, ap
);
359 _log_fn_function_name
= NULL
;
362 _log_debug(log_domain_mask_t domain
, const char *format
, ...)
365 /* For GCC we do this check in the macro. */
366 if (PREDICT_LIKELY(LOG_DEBUG
> _log_global_min_severity
))
369 logv(LOG_DEBUG
, domain
, _log_fn_function_name
, format
, ap
);
371 _log_fn_function_name
= NULL
;
374 _log_info(log_domain_mask_t domain
, const char *format
, ...)
377 if (LOG_INFO
> _log_global_min_severity
)
380 logv(LOG_INFO
, domain
, _log_fn_function_name
, format
, ap
);
382 _log_fn_function_name
= NULL
;
385 _log_notice(log_domain_mask_t domain
, const char *format
, ...)
388 if (LOG_NOTICE
> _log_global_min_severity
)
391 logv(LOG_NOTICE
, domain
, _log_fn_function_name
, format
, ap
);
393 _log_fn_function_name
= NULL
;
396 _log_warn(log_domain_mask_t domain
, const char *format
, ...)
399 if (LOG_WARN
> _log_global_min_severity
)
402 logv(LOG_WARN
, domain
, _log_fn_function_name
, format
, ap
);
404 _log_fn_function_name
= NULL
;
407 _log_err(log_domain_mask_t domain
, const char *format
, ...)
410 if (LOG_ERR
> _log_global_min_severity
)
413 logv(LOG_ERR
, domain
, _log_fn_function_name
, format
, ap
);
415 _log_fn_function_name
= NULL
;
419 /** Free all storage held by <b>victim</b>. */
421 log_free(logfile_t
*victim
)
423 tor_free(victim
->severities
);
424 tor_free(victim
->filename
);
428 /** Close all open log files, and free other static memory. */
432 logfile_t
*victim
, *next
;
444 tor_mutex_free(log_mutex
);
448 /** Remove and free the log entry <b>victim</b> from the linked-list
449 * logfiles (it is probably present, but it might not be due to thread
450 * racing issues). After this function is called, the caller shouldn't
451 * refer to <b>victim</b> anymore.
453 * Long-term, we need to do something about races in the log subsystem
454 * in general. See bug 222 for more details.
457 delete_log(logfile_t
*victim
)
460 if (victim
== logfiles
)
461 logfiles
= victim
->next
;
463 for (tmpl
= logfiles
; tmpl
&& tmpl
->next
!= victim
; tmpl
=tmpl
->next
) ;
465 // tor_assert(tmpl->next == victim);
468 tmpl
->next
= victim
->next
;
473 /** Helper: release system resources (but not memory) held by a single
476 close_log(logfile_t
*victim
)
478 if (victim
->needs_close
&& victim
->fd
>= 0) {
481 } else if (victim
->is_syslog
) {
483 if (--syslog_count
== 0) {
484 /* There are no other syslogs; close the logging facility. */
491 /** Adjust a log severity configuration in <b>severity_out</b> to contain
492 * every domain between <b>loglevelMin</b> and <b>loglevelMax</b>, inclusive.
495 set_log_severity_config(int loglevelMin
, int loglevelMax
,
496 log_severity_list_t
*severity_out
)
499 tor_assert(loglevelMin
>= loglevelMax
);
500 tor_assert(loglevelMin
>= LOG_ERR
&& loglevelMin
<= LOG_DEBUG
);
501 tor_assert(loglevelMax
>= LOG_ERR
&& loglevelMax
<= LOG_DEBUG
);
502 memset(severity_out
, 0, sizeof(log_severity_list_t
));
503 for (i
= loglevelMin
; i
>= loglevelMax
; --i
) {
504 severity_out
->masks
[SEVERITY_MASK_IDX(i
)] = ~0u;
508 /** Add a log handler named <b>name</b> to send all messages in <b>severity</b>
509 * to <b>fd</b>. Copies <b>severity</b>. Helper: does no locking. */
511 add_stream_log_impl(const log_severity_list_t
*severity
,
512 const char *name
, int fd
)
515 lf
= tor_malloc_zero(sizeof(logfile_t
));
517 lf
->filename
= tor_strdup(name
);
518 lf
->severities
= tor_memdup(severity
, sizeof(log_severity_list_t
));
522 _log_global_min_severity
= get_min_log_level();
525 /** Add a log handler named <b>name</b> to send all messages in <b>severity</b>
526 * to <b>fd</b>. Steals a reference to <b>severity</b>; the caller must
527 * not use it after calling this function. */
529 add_stream_log(const log_severity_list_t
*severity
,
530 const char *name
, int fd
)
533 add_stream_log_impl(severity
, name
, fd
);
537 /** Initialize the global logging facility */
542 log_mutex
= tor_mutex_new();
545 /** Add a log handler to receive messages during startup (before the real
546 * logs are initialized).
549 add_temp_log(int min_severity
)
551 log_severity_list_t
*s
= tor_malloc_zero(sizeof(log_severity_list_t
));
552 set_log_severity_config(min_severity
, LOG_ERR
, s
);
554 add_stream_log_impl(s
, "<temp>", fileno(stdout
));
556 logfiles
->is_temporary
= 1;
561 * Add a log handler to send messages in <b>severity</b>
562 * to the function <b>cb</b>.
565 add_callback_log(const log_severity_list_t
*severity
, log_callback cb
)
568 lf
= tor_malloc_zero(sizeof(logfile_t
));
570 lf
->severities
= tor_memdup(severity
, sizeof(log_severity_list_t
));
571 lf
->filename
= tor_strdup("<callback>");
577 _log_global_min_severity
= get_min_log_level();
582 /** Adjust the configured severity of any logs whose callback function is
585 change_callback_log_severity(int loglevelMin
, int loglevelMax
,
589 log_severity_list_t severities
;
590 set_log_severity_config(loglevelMin
, loglevelMax
, &severities
);
592 for (lf
= logfiles
; lf
; lf
= lf
->next
) {
593 if (lf
->callback
== cb
) {
594 memcpy(lf
->severities
, &severities
, sizeof(severities
));
597 _log_global_min_severity
= get_min_log_level();
601 /** Close any log handlers added by add_temp_log() or marked by
602 * mark_logs_temp(). */
604 close_temp_logs(void)
609 for (p
= &logfiles
; *p
; ) {
610 if ((*p
)->is_temporary
) {
612 /* we use *p here to handle the edge case of the head of the list */
621 _log_global_min_severity
= get_min_log_level();
625 /** Make all currently temporary logs (set to be closed by close_temp_logs)
626 * live again, and close all non-temporary logs. */
628 rollback_log_changes(void)
632 for (lf
= logfiles
; lf
; lf
= lf
->next
)
633 lf
->is_temporary
= ! lf
->is_temporary
;
638 /** Configure all log handles to be closed by close_temp_logs(). */
644 for (lf
= logfiles
; lf
; lf
= lf
->next
)
645 lf
->is_temporary
= 1;
650 * Add a log handler to send messages to <b>filename</b>. If opening the
651 * logfile fails, -1 is returned and errno is set appropriately (by open(2)).
654 add_file_log(const log_severity_list_t
*severity
, const char *filename
)
659 fd
= open(filename
, O_WRONLY
|O_CREAT
|O_APPEND
, 0644);
662 if (tor_fd_seekend(fd
)<0)
666 add_stream_log_impl(severity
, filename
, fd
);
667 logfiles
->needs_close
= 1;
669 _log_global_min_severity
= get_min_log_level();
672 if (log_tor_version(lf
, 0) < 0) {
683 * Add a log handler to send messages to they system log facility.
686 add_syslog_log(const log_severity_list_t
*severity
)
689 if (syslog_count
++ == 0)
690 /* This is the first syslog. */
691 openlog("Tor", LOG_PID
| LOG_NDELAY
, LOGFACILITY
);
693 lf
= tor_malloc_zero(sizeof(logfile_t
));
695 lf
->severities
= tor_memdup(severity
, sizeof(log_severity_list_t
));
696 lf
->filename
= tor_strdup("<syslog>");
703 _log_global_min_severity
= get_min_log_level();
709 /** If <b>level</b> is a valid log severity, return the corresponding
710 * numeric value. Otherwise, return -1. */
712 parse_log_level(const char *level
)
714 if (!strcasecmp(level
, "err"))
716 if (!strcasecmp(level
, "warn"))
718 if (!strcasecmp(level
, "notice"))
720 if (!strcasecmp(level
, "info"))
722 if (!strcasecmp(level
, "debug"))
727 /** Return the string equivalent of a given log level. */
729 log_level_to_string(int level
)
731 return sev_to_string(level
);
734 /** NULL-terminated array of names for log domains such that domain_list[dom]
735 * is a description of <b>dom</b>. */
736 static const char *domain_list
[] = {
737 "GENERAL", "CRYPTO", "NET", "CONFIG", "FS", "PROTOCOL", "MM",
738 "HTTP", "APP", "CONTROL", "CIRC", "REND", "BUG", "DIR", "DIRSERV",
739 "OR", "EDGE", "ACCT", "HIST", NULL
742 /** Return the log domain for which <b>domain</b> is the name, or 0 if there
743 * is no such name. */
744 /*XXXX021 0 could mean "no such domain" or LD_GENERAL. Fix that. */
745 static log_domain_mask_t
746 parse_log_domain(const char *domain
)
749 for (i
=0; domain_list
[i
]; ++i
) {
750 if (!strcasecmp(domain
, domain_list
[i
]))
758 domain_to_string(log_domain_mask_t domain
)
760 int bit
= tor_log2(domain
);
761 if ((bit
== 0 && domain
== 0) || bit
>= N_LOGGING_DOMAINS
)
763 return domain_list
[bit
];
767 /** Parse a log severity pattern in *<b>cfg_ptr</b>. Advance cfg_ptr after
768 * the end of the severityPattern. Set the value of <b>severity_out</b> to
769 * the parsed pattern. Return 0 on success, -1 on failure.
771 * The syntax for a SeverityPattern is:
773 * SeverityPattern = *(DomainSeverity SP)* DomainSeverity
774 * DomainSeverity = (DomainList SP)? SeverityRange
775 * SeverityRange = MinSeverity ("-" MaxSeverity )?
776 * DomainList = "[" (SP? DomainSpec SP? ",") SP? DomainSpec "]"
777 * DomainSpec = "*" | Domain | "~" Domain
779 * A missing MaxSeverity defaults to ERR. Severities and domains are
780 * case-insensitive. "~" indicates negation for a domain; negation happens
781 * last inside a DomainList. Only one SeverityRange without a DomainList is
785 parse_log_severity_config(const char **cfg_ptr
,
786 log_severity_list_t
*severity_out
)
788 const char *cfg
= *cfg_ptr
;
789 int got_anything
= 0;
790 int got_an_unqualified_range
= 0;
791 memset(severity_out
, 0, sizeof(*severity_out
));
793 cfg
= eat_whitespace(cfg
);
795 const char *dash
, *space
;
796 char *sev_lo
, *sev_hi
;
798 log_domain_mask_t domains
= ~0u;
803 smartlist_t
*domains_list
;
804 log_domain_mask_t neg_domains
= 0;
805 const char *closebracket
= strchr(cfg
, ']');
809 domains_str
= tor_strndup(cfg
+1, closebracket
-cfg
-1);
810 domains_list
= smartlist_create();
811 smartlist_split_string(domains_list
, domains_str
, ",", SPLIT_SKIP_SPACE
,
813 tor_free(domains_str
);
814 SMARTLIST_FOREACH(domains_list
, const char *, domain
,
816 if (!strcmp(domain
, "*")) {
821 if (*domain
== '~') {
825 d
= parse_log_domain(domain
);
827 log_warn(LD_CONFIG
, "No such loggging domain as %s", domain
);
837 SMARTLIST_FOREACH(domains_list
, char *, d
, tor_free(d
));
838 smartlist_free(domains_list
);
841 domains
&= ~neg_domains
;
842 cfg
= eat_whitespace(closebracket
+1);
844 ++got_an_unqualified_range
;
846 if (!strcasecmpstart(cfg
, "file") ||
847 !strcasecmpstart(cfg
, "stderr") ||
848 !strcasecmpstart(cfg
, "stdout") ||
849 !strcasecmpstart(cfg
, "syslog")) {
852 if (got_an_unqualified_range
> 1)
855 space
= strchr(cfg
, ' ');
856 dash
= strchr(cfg
, '-');
858 space
= strchr(cfg
, '\0');
859 if (dash
&& dash
< space
) {
860 sev_lo
= tor_strndup(cfg
, dash
-cfg
);
861 sev_hi
= tor_strndup(dash
+1, space
-(dash
+1));
863 sev_lo
= tor_strndup(cfg
, space
-cfg
);
864 sev_hi
= tor_strdup("ERR");
866 low
= parse_log_level(sev_lo
);
867 high
= parse_log_level(sev_hi
);
876 for (i
=low
; i
>= high
; --i
)
877 severity_out
->masks
[SEVERITY_MASK_IDX(i
)] |= domains
;
879 cfg
= eat_whitespace(space
);
884 return got_anything
? 0 : -1;
887 /** Return the least severe log level that any current log is interested in. */
889 get_min_log_level(void)
894 for (lf
= logfiles
; lf
; lf
= lf
->next
) {
895 for (i
= LOG_DEBUG
; i
> min
; --i
)
896 if (lf
->severities
->masks
[SEVERITY_MASK_IDX(i
)])
902 /** Switch all logs to output at most verbose level. */
904 switch_logs_debug(void)
909 for (lf
= logfiles
; lf
; lf
=lf
->next
) {
910 for (i
= LOG_DEBUG
; i
>= LOG_ERR
; --i
)
911 lf
->severities
->masks
[SEVERITY_MASK_IDX(i
)] = ~0u;
913 _log_global_min_severity
= get_min_log_level();
917 #ifdef HAVE_EVENT_SET_LOG_CALLBACK
918 /** A string which, if it appears in a libevent log, should be ignored. */
919 static const char *suppress_msg
= NULL
;
920 /** Callback function passed to event_set_log() so we can intercept
921 * log messages from libevent. */
923 libevent_logging_callback(int severity
, const char *msg
)
927 if (suppress_msg
&& strstr(msg
, suppress_msg
))
929 n
= strlcpy(buf
, msg
, sizeof(buf
));
930 if (n
&& n
< sizeof(buf
) && buf
[n
-1] == '\n') {
934 case _EVENT_LOG_DEBUG
:
935 log(LOG_DEBUG
, LD_NET
, "Message from libevent: %s", buf
);
938 log(LOG_INFO
, LD_NET
, "Message from libevent: %s", buf
);
940 case _EVENT_LOG_WARN
:
941 log(LOG_WARN
, LD_GENERAL
, "Warning from libevent: %s", buf
);
944 log(LOG_ERR
, LD_GENERAL
, "Error from libevent: %s", buf
);
947 log(LOG_WARN
, LD_GENERAL
, "Message [%d] from libevent: %s",
952 /** Set hook to intercept log messages from libevent. */
954 configure_libevent_logging(void)
956 event_set_log_callback(libevent_logging_callback
);
958 /** Ignore any libevent log message that contains <b>msg</b>. */
960 suppress_libevent_log_msg(const char *msg
)
966 configure_libevent_logging(void)
970 suppress_libevent_log_msg(const char *msg
)
978 dump_log_info(logfile_t
*lf
)
983 printf("=== log into \"%s\" (%s-%s) (%stemporary)\n", lf
->filename
,
984 sev_to_string(lf
->min_loglevel
),
985 sev_to_string(lf
->max_loglevel
),
986 lf
->is_temporary
?"":"not ");
987 } else if (lf
->is_syslog
) {
988 printf("=== syslog (%s-%s) (%stemporary)\n",
989 sev_to_string(lf
->min_loglevel
),
990 sev_to_string(lf
->max_loglevel
),
991 lf
->is_temporary
?"":"not ");
993 printf("=== log (%s-%s) (%stemporary)\n",
994 sev_to_string(lf
->min_loglevel
),
995 sev_to_string(lf
->max_loglevel
),
996 lf
->is_temporary
?"":"not ");
1004 printf("==== BEGIN LOGS ====\n");
1005 for (lf
= logfiles
; lf
; lf
= lf
->next
)
1007 printf("==== END LOGS ====\n");