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.

33 lines
833 B

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #include "objectMySQLLoggingService.h"
  2. objectMySQLLoggingService::objectMySQLLoggingService(){
  3. m_bLogging = false;
  4. m_pDBC = NULL;
  5. };
  6. objectMySQLLoggingService::objectMySQLLoggingService( serverDataBinder *ptr ){
  7. m_pDBC = ptr;
  8. m_bLogging = ( m_pDBC != NULL );
  9. };
  10. void objectMySQLLoggingService::logMessage( CSTR Msg ){
  11. if( !m_bLogging ) return;
  12. logMessage( (const char * ) Msg );
  13. };
  14. void objectMySQLLoggingService::logMessage( const char *Msg ){
  15. if( !m_bLogging ) return;
  16. if( m_pDBC ){
  17. char tType[3];
  18. char tTS[20];
  19. strncpy( tType, Msg, 2);
  20. tType[2] = (char) 0;
  21. strncpy( tTS, Msg+3, 19);
  22. tTS[19] = (char) 0;
  23. CSTR tMsg = (CSTR)Msg+23;
  24. m_pDBC->putIntoLog( tType, tTS, tMsg );
  25. } else {
  26. m_bLogging = false;
  27. };
  28. };