Source
xxxxxxxxxx
void zbx_strlog_alloc(int level, char **out, size_t *out_alloc, size_t *out_offset, const char *format, ...)
/*
** Zabbix
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
static HANDLE system_log_handle = INVALID_HANDLE_VALUE;
static char log_filename[MAX_STRING_LEN];
static int log_type = LOG_TYPE_UNDEFINED;
static zbx_mutex_t log_access = ZBX_MUTEX_NULL;
int zbx_log_level = LOG_LEVEL_WARNING;
const char *zabbix_get_log_level_string(void)
{
switch (zbx_log_level)
{
case LOG_LEVEL_EMPTY:
return "0 (none)";
case LOG_LEVEL_CRIT:
return "1 (critical)";
case LOG_LEVEL_ERR:
return "2 (error)";
case LOG_LEVEL_WARNING:
return "3 (warning)";
case LOG_LEVEL_DEBUG:
return "4 (debug)";
case LOG_LEVEL_TRACE:
return "5 (trace)";
}
THIS_SHOULD_NEVER_HAPPEN;
exit(EXIT_FAILURE);
}
int zabbix_increase_log_level(void)
{
if (LOG_LEVEL_TRACE == zbx_log_level)
return FAIL;
zbx_log_level = zbx_log_level + 1;
return SUCCEED;
}