Exemplo n.º 1
0
void cs_disable_log(int8_t disabled)
{
	if(cfg.disablelog != disabled)
	{
		if(disabled && logStarted)
		{
			cs_log("Stopping log...");
			log_list_flush();
		}
		cfg.disablelog = disabled;
		if(disabled)
		{
			if(logStarted)
			{
				if(syslog_socket != -1)
				{
					close(syslog_socket);
					syslog_socket = -1;					
				}
				
				cs_sleepms(20);
				cs_close_log();
			}
		}
		else
		{
			init_syslog_socket();
			cs_open_logfiles();
		}
	}
}
Exemplo n.º 2
0
void log_free(void)
{
	cs_close_log();
	log_running = 0;
	pthread_cond_signal(&log_thread_sleep_cond);
	pthread_join(log_thread, NULL);
#if defined(WEBIF) || defined(MODULE_MONITOR)
	NULLFREE(loghist);
	loghist = loghistptr = NULL;
#endif
}
Exemplo n.º 3
0
void log_free(void)
{
	if(syslog_socket != -1)
	{
		close(syslog_socket);
		syslog_socket = -1;
	}
	cs_close_log();
	log_running = 0;
	SAFE_COND_SIGNAL_NOLOG(&log_thread_sleep_cond);
	SAFE_THREAD_JOIN_NOLOG(log_thread, NULL);
#if defined(WEBIF) || defined(MODULE_MONITOR)
	NULLFREE(loghist);
	NULLFREE(loghistid);
	loghist = loghistptr = loghistid = NULL;
#endif
}
Exemplo n.º 4
0
void cs_disable_log(int8_t disabled)
{
	if (cfg.disablelog != disabled) {
		if(disabled && logStarted) {
			cs_log("Stopping log...");
			int32_t i = 0;
			while(ll_count(log_list) > 0 && i < 200){
				cs_sleepms(5);
				++i;
			}
		}
		cfg.disablelog = disabled;
		if (disabled){
			if(logStarted) {
				cs_sleepms(20);
				cs_close_log();
			}
		} else {
			cs_open_logfiles();
		}
	}
}
Exemplo n.º 5
0
void cs_disable_log(int8_t disabled)
{
	if(cfg.disablelog != disabled)
	{
		if(disabled && logStarted)
		{
			cs_log("Stopping log...");
			log_list_flush();
		}
		cfg.disablelog = disabled;
		if(disabled)
		{
			if(logStarted)
			{
				cs_sleepms(20);
				cs_close_log();
			}
		}
		else
		{
			cs_open_logfiles();
		}
	}
}