You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

71 lines
2.0 KiB

#ifndef __OBJECTMYSQLLOGGINGSERVICE_H_INCL__
#define __OBJECTMYSQLLOGGINGSERVICE_H_INCL__
#include <time.h>
#include <deque>
#include <mutex>
#include <string>
#include "../components/base/basicFunctionality.h"
#include "../components/base/basicLoggingService.h"
#include "../common/serverDataBinder.h"
/**
* TODO: Add class description
*
* @author Gagua
*/
// Lines waiting for the database (it is busy, or the line was logged by a thread inside a DB call)
#define MYSQL_LOG_MAX_PENDING 1000
typedef struct S_MYSQL_LOG_LINE{
char type[3];
char ts[20];
std::string msg;
} MYSQL_LOG_LINE;
class objectMySQLLoggingService : public basicLoggingService {
private:
bool m_bLogging;
serverDataBinder * m_pDBC;
std::deque<MYSQL_LOG_LINE> m_qPending;
std::mutex m_mPending;
public:
// Constructor
objectMySQLLoggingService();
objectMySQLLoggingService( serverDataBinder *ptr );
// Destructor
~objectMySQLLoggingService(){};
void logMessage( CSTR Msg );
void logMessage( const char *Msg );
// Copy constructor
// TODO: Uncomment the copy constructor when you need it.
//objectFileLoggingService(const objectFileLoggingService& src);
// Assignment operator
// TODO: Uncomment the assignment operator when you need it.
//objectFileLoggingService& operator=(const objectFileLoggingService& src);
};
// TODO: Uncomment the copy constructor when you need it.
//inline objectFileLoggingService::objectFileLoggingService(const objectFileLoggingService& src)
//{
// // TODO: copy
//}
// TODO: Uncomment the assignment operator when you need it.
//inline objectFileLoggingService& objectFileLoggingService::operator=(const objectFileLoggingService& rhs)
//{
// if (this == &rhs) {
// return *this;
// }
//
// // TODO: assignment
//
// return *this;
//}
#endif // __OBJECTFILELOGGINGSERVICE_H_INCL__