/*
 * oclh_h_base_log.h
 *
 *  Created on: 17 March 2020
 *      Author: havock
 */

#ifndef OCLH_H_BASE_LOG_H_
#define OCLH_H_BASE_LOG_H_ 1
#include <stdio.h>
#include <stdint.h>
#include <pthread.h>
#include <oclh_h_errors.h>

typedef enum _GHE_LOG_LEVEL {
    _GHE_LOG_DEFAULT  = 0,
    _GHE_LOG_KEY_PARS = 1,
    _GHE_LOG_ALL      = 2
} _GHE_LOGLVL;

#pragma pack(push,1)
typedef struct _GHT_LOGFILE {
    FILE*            pfOut;
    pthread_mutex_t* pMtx;
} _GHT_LOG;
#pragma pack(pop)

_GHT_LOG _ghf_declLog(void);
int32_t  _ghf_genrLog(_GHT_LOG* const pLog, const char* const pcFileName);
int32_t  _ghf_isLog_Valid(const _GHT_LOG Log);
int32_t  _ghf_wipeLog(_GHT_LOG* const pLog);

#endif /* OCLH_H_BASE_LOG_H_ */
