43 lines
1.1 KiB
C++
43 lines
1.1 KiB
C++
#pragma once
|
|
#include "base_head.h"
|
|
#include "lock.h"
|
|
#include <string>
|
|
typedef struct Msg_evento_log
|
|
{
|
|
int id_e;
|
|
char nivel[64];
|
|
char mensage[256];
|
|
__time64_t tiempo;
|
|
}Msg_evento_log;
|
|
class C_error;
|
|
class UTILES_EXPORT C_escucha_log//clase para escuchar eventos de log
|
|
{
|
|
public:
|
|
virtual void log_ext(__time64_t tiemp, char *modulo, char *fmt)=0;
|
|
};
|
|
class UTILES_EXPORT C_log//clase para logear eventos
|
|
{
|
|
public:
|
|
//variavles-----------------------------------------
|
|
HFILE archivo_log;
|
|
int nb;
|
|
Clock cerrojo;
|
|
C_escucha_log *l_lisener;//puntero a escucha actual
|
|
//BOOL log_consola;
|
|
char nombre[32];
|
|
char path[256];
|
|
|
|
void (*log_ext)(__time64_t tiemp, char *modulo, char *fmt);//funcion de log externa
|
|
C_log(void);
|
|
~C_log(void);
|
|
//funcion-------------------------------------------
|
|
void loguea(__time64_t tiemp, char *modulo, char *fmt);//añade un suceso
|
|
void loguea(char *modulo, char *fmt);//añade suceso actual
|
|
void loguea(C_error *er);//añade el error como suceso
|
|
static void log(char *modulo, char *fmt,...);//funcion estatica para loguear
|
|
static void log( C_error *er );
|
|
//static void log(std::string &mod, std::string &msg);
|
|
|
|
};
|
|
|