Important Update:
- Added SignalCore for handling system signals - Implemented LogMessages (only output to stdout, later to logfile) - Updated #defines for all header files
This commit is contained in:
24
LogCore.cpp
24
LogCore.cpp
@@ -13,10 +13,31 @@
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
// Global vars
|
||||
char ProcessName[20] = "Connect";
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
bool LogMessage( const char * Heading, const char *Message )
|
||||
{
|
||||
// Validate values
|
||||
if (!Message)
|
||||
return false;
|
||||
|
||||
// Show normal output
|
||||
if (!Heading) {
|
||||
printf( "%s\n", Message );
|
||||
}
|
||||
else {
|
||||
printf( "%s: %s\n", Heading, Message );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
bool ShowOutput( const char * Heading, const short Show, const char * Buffer, int Len )
|
||||
{
|
||||
// Validate values
|
||||
@@ -60,4 +81,3 @@ bool ShowOutput( const char * Heading, const short Show, const char * Buffer, in
|
||||
return true;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user