rename log_level_check() to log_check_level()

This commit is contained in:
luwenpeng
2024-08-26 11:05:43 +08:00
parent c08a1458d8
commit 2db9347109
6 changed files with 28 additions and 18 deletions

View File

@@ -2,33 +2,36 @@
#include <stddef.h>
#include <signal.h>
#include "stellar/log.h"
#include "stellar/stellar.h"
#include "stellar_core.h"
struct stellar *st = NULL;
static void signal_handler(int signo)
{
struct logger *logger = stellar_get_logger(st);
if (signo == SIGINT)
{
printf("SIGINT received, notify threads to exit\n");
STELLAR_LOG_FATAL(logger, "signal", "SIGINT received, notify threads to exit");
stellar_loopbreak(st);
}
if (signo == SIGQUIT)
{
printf("SIGQUIT received, notify threads to exit\n");
STELLAR_LOG_FATAL(logger, "signal", "SIGQUIT received, notify threads to exit");
stellar_loopbreak(st);
}
if (signo == SIGTERM)
{
printf("SIGTERM received, notify threads to exit\n");
STELLAR_LOG_FATAL(logger, "signal", "SIGTERM received, notify threads to exit");
stellar_loopbreak(st);
}
if (signo == SIGHUP)
{
printf("SIGHUP received, reload log level\n");
STELLAR_LOG_FATAL(logger, "signal", "SIGHUP received, reload log level");
stellar_reload_log_level(st);
}
}