liblog/lib/liblog.h

127 lines
4.8 KiB
C
Raw Normal View History

2024-04-17 10:50:09 +02:00
/*----------------------------------------------------------------------------*/
/* liblog.h */
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* This file is part of LibLog. */
2024-04-17 10:50:09 +02:00
/* */
/* LibLog is free software: you can redistribute it and/or modify it */
2024-04-17 10:50:09 +02:00
/* under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 of the License, or */
/* (at your option) any later version. */
/* */
/* LibLog is distributed in the hope that it will be useful, */
2024-04-17 10:50:09 +02:00
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public */
/* License along with Drummer. If not, see */
/* <https://www.gnu.org/licenses/>. */
/*----------------------------------------------------------------------------*/
2024-04-17 10:50:09 +02:00
/*----------------------------------------------------------------------------*/
/* Includes */
/*----------------------------------------------------------------------------*/
#include <log.h>
#include <execinfo.h>
#include <log.h>
/*----------------------------------------------------------------------------*/
/* Pre definitions */
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Definitions */
/*----------------------------------------------------------------------------*/
#define LGD_MODULE_NAME "lg"
/*---------------------------------------------------------------------------------*/
/* LGT_Base */
/*---------------------------------------------------------------------------------*/
typedef struct LGT_Base
{
FILE *Log_Stream_Out_Ptr;
char *Log_Type_Name_Tab[ LGD_LOG_TYPE_NB];
LGT_Log_Writer_Ptr Log_Writer_Ptr;
} LGT_Base;
#define LGD_LOG_STREAM_DEFAULT_VALUE ( FILE *)stderr
#define LGD_LOG_WRITER_DEFAULT_VALUE ( LGT_Log_Writer_Ptr)&LG_Log_Write
2024-04-17 10:50:09 +02:00
LGT_Base LGG_Base =
{
LGD_LOG_STREAM_DEFAULT,
{ LGD_LOG_TYPE_NAME_UNKNOWN, LGD_LOG_TYPE_NAME_TRACE, LGD_LOG_TYPE_NAME_INFO, LGD_LOG_TYPE_NAME_WARNING, LGD_LOG_TYPE_NAME_ERROR},
LGD_LOG_WRITER_DEFAULT
2024-04-17 10:50:09 +02:00
};
/*----------------------------------------------------------------------------*/
/* Private Prototypes */
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* LG_Log_Header */
/*----------------------------------------------------------------------------*/
LGT_Status LG_Log_Header( LGT_Log_Type_Id, ...);
/*----------------------------------------------------------------------------*/
/* LG_Log_Footer */
/*----------------------------------------------------------------------------*/
LGT_Status LG_Log_Footer( LGT_Log_Type_Id, ...);
/*----------------------------------------------------------------------------*/
/* LG_Log_Format */
/*----------------------------------------------------------------------------*/
LGT_Status LG_Log_Format( char *, LGT_Log_Type_Id, LGT_Log_Level, char *, char *, long, bool, char *);
/*----------------------------------------------------------------------------*/
/* LG_Log_Write */
/*----------------------------------------------------------------------------*/
LGT_Status LG_Log_Write( FILE *Log_Stream_Out_Ptr, LGT_Log_Type_Id, char *, va_list);
2024-04-17 10:50:09 +02:00
/*----------------------------------------------------------------------------*/