/*----------------------------------------------------------------------------*/ /* liblog.h */ /*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/ /* This file is part of LibLog. */ /* */ /* LibLog is free software: you can redistribute it and/or modify it */ /* 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, */ /* 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 LibLog. If not, see */ /* . */ /*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/ /* Includes */ /*----------------------------------------------------------------------------*/ #include #include #include /*----------------------------------------------------------------------------*/ /* 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 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 }; /*----------------------------------------------------------------------------*/ /* 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 *, const char *, const long, const char *, bool, char *); /*----------------------------------------------------------------------------*/ /* LG_Log_Write */ /*----------------------------------------------------------------------------*/ LGT_Status LG_Log_Write( FILE *Log_Stream_Out_Ptr, LGT_Log_Type_Id, char *, va_list); /*----------------------------------------------------------------------------*/