#include <platformstl/platformstl.h>
#include <pantheios/pantheios.h>
#include <pantheios/frontends/fe.N.h>
#include <pantheios/backends/be.N.h>
#include <pantheios/backends/bec.file.h>
#include <pantheios/backends/bec.fprintf.h>
#include <pantheios/backends/bec.null.h>
#if defined(PLATFORMSTL_OS_IS_UNIX)
# include <pantheios/backends/bec.syslog.h>
#elif defined(PLATFORMSTL_OS_IS_WINDOWS)
# include <pantheios/backends/bec.WindowsSyslog.h>
#else
# error Operating system not discriminated
#endif
#include <stdlib.h>
const PAN_CHAR_T PANTHEIOS_FE_PROCESS_IDENTITY[] = PANTHEIOS_LITERAL_STRING("example.c.N");
pan_fe_N_t PAN_FE_N_SEVERITY_CEILINGS[] =
{
{ 1, PANTHEIOS_SEV_NOTICE }
, { 2, PANTHEIOS_SEV_DEBUG }
, { 3, PANTHEIOS_SEV_ERROR }
, { 0, PANTHEIOS_SEV_NOTICE }
};
pan_be_N_t PAN_BE_N_BACKEND_LIST[] =
{
PANTHEIOS_BE_N_STDFORM_ENTRY(1, pantheios_be_file, 0)
, PANTHEIOS_BE_N_STDFORM_ENTRY(2, pantheios_be_fprintf, 0)
, PANTHEIOS_BE_N_STDFORM_ENTRY(3, pantheios_be_null, 0)
#if defined(PLATFORMSTL_OS_IS_UNIX)
, PANTHEIOS_BE_N_STDFORM_ENTRY(4, pantheios_be_syslog, 0)
#elif defined(PLATFORMSTL_OS_IS_WINDOWS)
, PANTHEIOS_BE_N_STDFORM_ENTRY(4, pantheios_be_WindowsSyslog, 0)
#endif
, PANTHEIOS_BE_N_STDFORM_ENTRY(5, pantheios_be_file, 0)
, PANTHEIOS_BE_N_TERMINATOR_ENTRY
};
int main()
{
if(pantheios_init() < 0)
{
return EXIT_FAILURE;
}
else
{
pantheios_logputs(PANTHEIOS_SEV_DEBUG, PANTHEIOS_LITERAL_STRING("debug"));
pantheios_logputs(PANTHEIOS_SEV_INFORMATIONAL, PANTHEIOS_LITERAL_STRING("info"));
pantheios_logputs(PANTHEIOS_SEV_NOTICE, PANTHEIOS_LITERAL_STRING("notice"));
pantheios_logputs(PANTHEIOS_SEV_WARNING, PANTHEIOS_LITERAL_STRING("warn"));
pantheios_be_file_setFilePath(PANTHEIOS_LITERAL_STRING("file-1.log"), PANTHEIOS_BE_FILE_F_TRUNCATE, PANTHEIOS_BE_FILE_F_TRUNCATE, 1);
pantheios_logputs(PANTHEIOS_SEV_ERROR, PANTHEIOS_LITERAL_STRING("error"));
pantheios_logputs(PANTHEIOS_SEV_CRITICAL, PANTHEIOS_LITERAL_STRING("critical"));
pantheios_logputs(PANTHEIOS_SEV_ALERT, PANTHEIOS_LITERAL_STRING("alert"));
pantheios_logputs(PANTHEIOS_SEV_EMERGENCY, PANTHEIOS_LITERAL_STRING("emergency"));
pantheios_be_file_setFilePath(PANTHEIOS_LITERAL_STRING("file-5.log"), 0, 0, 5);
pantheios_uninit();
return EXIT_SUCCESS;
}
}