forked from kernelslacker/trinity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlog.c
39 lines (35 loc) · 698 Bytes
/
log.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include "log.h"
#include "logfile.h"
#include "params.h" // logging, quiet_level
#include "pids.h"
#include "shm.h"
void init_logging(void)
{
if (logging == LOGGING_DISABLED)
return;
open_main_logfile();
}
void shutdown_logging(void)
{
if (logging == LOGGING_DISABLED)
return;
close_logfile(&mainlogfile);
}
void init_child_logging(struct childdata *child)
{
if (logging == LOGGING_DISABLED)
return;
open_child_logfile(child);
}
void shutdown_child_logging(struct childdata *child)
{
if (logging == LOGGING_DISABLED)
return;
close_logfile(&child->logfile);
}