tor  0.4.2.0-alpha-dev
log_sys.c
Go to the documentation of this file.
1 /* Copyright (c) 2018-2019, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
3 
9 #include "orconfig.h"
10 #include "lib/subsys/subsys.h"
11 #include "lib/log/escape.h"
12 #include "lib/log/log.h"
13 #include "lib/log/log_sys.h"
14 
15 static int
16 subsys_logging_initialize(void)
17 {
18  init_logging(0);
19  return 0;
20 }
21 
22 static void
23 subsys_logging_shutdown(void)
24 {
25  logs_free_all();
26  escaped(NULL);
27 }
28 
29 const subsys_fns_t sys_logging = {
30  .name = "log",
31  .supported = true,
32  /* Logging depends on threads, approx time, raw logging, and security.
33  * Most other lib modules depend on logging. */
34  .level = -90,
35  .initialize = subsys_logging_initialize,
36  .shutdown = subsys_logging_shutdown,
37 };
void init_logging(int disable_startup_queue)
Definition: log.c:965
void logs_free_all(void)
Definition: log.c:801
Declare subsystem object for the logging module.
const char * escaped(const char *s)
Definition: escape.c:126
Header for escape.c.
const char * name
Definition: subsys.h:28
Headers for log.c.