mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
refactor: log_{start,stop} -> log_{open,close}
This commit is contained in:
parent
63e839afc9
commit
63a4634d57
9 changed files with 17 additions and 17 deletions
|
@ -113,9 +113,9 @@ struct log default_log;
|
|||
/** Initialize log object */
|
||||
int log_init(struct log *l, int level, long faciltities);
|
||||
|
||||
int log_start(struct log *l);
|
||||
int log_open(struct log *l);
|
||||
|
||||
int log_stop(struct log *l);
|
||||
int log_close(struct log *l);
|
||||
|
||||
/** Destroy log object */
|
||||
int log_destroy(struct log *l);
|
||||
|
|
12
lib/log.c
12
lib/log.c
|
@ -54,7 +54,7 @@ void register_default_log()
|
|||
if (ret)
|
||||
error("Failed to initalize log");
|
||||
|
||||
ret = log_start(&default_log);
|
||||
ret = log_open(&default_log);
|
||||
if (ret)
|
||||
error("Failed to start log");
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ int log_init(struct log *l, int level, long facilitites)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int log_start(struct log *l)
|
||||
int log_open(struct log *l)
|
||||
{
|
||||
if (l->path) {
|
||||
l->file = fopen(l->path, "a+");;
|
||||
|
@ -185,7 +185,7 @@ int log_start(struct log *l)
|
|||
else
|
||||
l->file = stderr;
|
||||
|
||||
l->state = STATE_STARTED;
|
||||
l->state = STATE_OPENED;
|
||||
|
||||
if (l->syslog) {
|
||||
openlog(NULL, LOG_PID, LOG_DAEMON);
|
||||
|
@ -196,9 +196,9 @@ int log_start(struct log *l)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int log_stop(struct log *l)
|
||||
int log_close(struct log *l)
|
||||
{
|
||||
if (l->state != STATE_STARTED)
|
||||
if (l->state != STATE_OPENED)
|
||||
return 0;
|
||||
|
||||
if (l->file != stderr && l->file != stdout) {
|
||||
|
@ -209,7 +209,7 @@ int log_stop(struct log *l)
|
|||
closelog();
|
||||
}
|
||||
|
||||
l->state = STATE_STOPPED;
|
||||
l->state = STATE_CLOSED;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -346,7 +346,7 @@ int super_node_start(struct super_node *sn)
|
|||
memory_init(sn->hugepages);
|
||||
rt_init(sn->priority, sn->affinity);
|
||||
|
||||
log_start(&sn->log);
|
||||
log_open(&sn->log);
|
||||
#ifdef WITH_API
|
||||
api_start(&sn->api);
|
||||
#endif
|
||||
|
@ -442,7 +442,7 @@ int super_node_stop(struct super_node *sn)
|
|||
#ifdef WITH_WEB
|
||||
web_stop(&sn->web);
|
||||
#endif
|
||||
log_stop(&sn->log);
|
||||
log_close(&sn->log);
|
||||
|
||||
sn->state = STATE_STOPPED;
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ check: if (optarg == endptr)
|
|||
if (ret)
|
||||
error("Failed to initialize log");
|
||||
|
||||
ret = log_start(&log);
|
||||
ret = log_open(&log);
|
||||
if (ret)
|
||||
error("Failed to start log");
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@ check: if (optarg == endptr)
|
|||
if (ret)
|
||||
error("Failed to initialize log");
|
||||
|
||||
ret = log_start(&l);
|
||||
ret = log_open(&l);
|
||||
if (ret)
|
||||
error("Failed to start log");
|
||||
|
||||
|
|
|
@ -301,7 +301,7 @@ check: if (optarg == endptr)
|
|||
if (ret)
|
||||
error("Failed to initialize log");
|
||||
|
||||
ret = log_start(&sn.log);
|
||||
ret = log_open(&sn.log);
|
||||
if (ret)
|
||||
error("Failed to start log");
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ static void quit(int signal, siginfo_t *sinfo, void *ctx)
|
|||
if (ret)
|
||||
error("Failed to destroy pool");
|
||||
|
||||
ret = log_stop(&l);
|
||||
ret = log_close(&l);
|
||||
if (ret)
|
||||
error("Failed to stop log");
|
||||
|
||||
|
@ -116,7 +116,7 @@ int main(int argc, char *argv[])
|
|||
if (ret)
|
||||
error("Failed to initialize log");
|
||||
|
||||
ret = log_start(&l);
|
||||
ret = log_open(&l);
|
||||
if (ret)
|
||||
error("Failed to start log");
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ int main(int argc, char* argv[])
|
|||
};
|
||||
|
||||
log_init(&log, V, LOG_ALL);
|
||||
log_start(&log);
|
||||
log_open(&log);
|
||||
|
||||
|
||||
if (argc != 4) {
|
||||
|
|
|
@ -38,7 +38,7 @@ int main(int argc, char *argv[])
|
|||
if (ret)
|
||||
error("Failed to initialize logging sub-system");
|
||||
|
||||
ret = log_start(&log);
|
||||
ret = log_open(&log);
|
||||
if (ret)
|
||||
error("Failed to start logging sub-system");
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue