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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
#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"
#include "udp.h"
void init_logging(void)
{
switch (logging) {
case LOGGING_DISABLED:
return;
case LOGGING_FILES:
open_main_logfile();
return;
case LOGGING_UDP:
init_udp_logging(logging_args);
return;
}
}
void shutdown_logging(void)
{
switch (logging) {
case LOGGING_DISABLED:
return;
case LOGGING_FILES:
close_logfile(&mainlogfile);
return;
case LOGGING_UDP:
return;
}
}
void init_child_logging(struct childdata *child)
{
switch (logging) {
case LOGGING_DISABLED:
return;
case LOGGING_FILES:
open_child_logfile(child);
return;
case LOGGING_UDP:
shutdown_udp_logging();
return;
}
}
void shutdown_child_logging(struct childdata *child)
{
switch (logging) {
case LOGGING_DISABLED:
return;
case LOGGING_FILES:
close_logfile(&child->logfile);
return;
case LOGGING_UDP:
return;
}
}
|