Tor
0.4.6.0-alpha-dev
lib
log
log_sys.c
Go to the documentation of this file.
1
/* Copyright (c) 2018-2020, The Tor Project, Inc. */
2
/* See LICENSE for licensing information */
3
4
/**
5
* \file log_sys.c
6
* \brief Setup and tear down the logging module.
7
**/
8
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
SUBSYS_DECLARE_LOCATION
(),
32
.supported =
true
,
33
/* Logging depends on threads, approx time, raw logging, and security.
34
* Most other lib modules depend on logging. */
35
.level = -90,
36
.initialize = subsys_logging_initialize,
37
.shutdown = subsys_logging_shutdown,
38
};
SUBSYS_DECLARE_LOCATION
#define SUBSYS_DECLARE_LOCATION()
Definition:
subsys.h:211
init_logging
void init_logging(int disable_startup_queue)
Definition:
log.c:911
logs_free_all
void logs_free_all(void)
Definition:
log.c:745
escape.h
Header for escape.c.
subsys.h
Types used to declare a subsystem.
log_sys.h
Declare subsystem object for the logging module.
subsys_fns_t::name
const char * name
Definition:
subsys.h:43
escaped
const char * escaped(const char *s)
Definition:
escape.c:126
log.h
Headers for log.c.
subsys_fns_t
Definition:
subsys.h:38
Generated by
1.8.20