Tor  0.4.4.0-alpha-dev
quiet_level.c
Go to the documentation of this file.
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-2020, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
7 /**
8  * @file quiet_level.c
9  * @brief Code to handle default logging level (quiet/hush/normal).
10  **/
11 
12 #include "orconfig.h"
13 #include "lib/log/log.h"
14 #include "app/config/quiet_level.h"
15 
16 /** Decides our behavior when no logs are configured/before any logs have been
17  * configured. For QUIET_NONE, we log notice to stdout as normal. For
18  * QUIET_HUSH, we log warnings only. For QUIET_SILENT, we log nothing.
19  */
21 
22 /** Add a default log (or not), depending on the value of <b>quiet</b>. */
23 void
25 {
26  switch (quiet) {
27  case QUIET_SILENT:
28  /* --quiet: no initial logging */
29  return;
30  case QUIET_HUSH:
31  /* --hush: log at warning or higher. */
33  break;
34  case QUIET_NONE: /* fall through */
35  default:
37  }
38 }
Declare the quiet_level enumeration and global.
void add_default_log_for_quiet_level(quiet_level_t quiet)
Definition: quiet_level.c:24
#define LOG_NOTICE
Definition: log.h:50
quiet_level_t quiet_level
Definition: quiet_level.c:20
#define LOG_WARN
Definition: log.h:53
int quiet
Definition: config.c:2447
void add_default_log(int min_severity)
Definition: log.c:1001
quiet_level_t
Definition: quiet_level.h:16
Headers for log.c.