Files
redAcore/LogCore.h
Charl Wentzel aaf3c59727 Important Updates:
- DataTreeCore:
  - Allow types float, int & bool to be read as strings with GetStr()
- LogCore:
  - Add comments to Logging parameters
- WatchDogCore:
  - Call CSelectableCore::Process() in Process() to manage connect
- SelectableCore:
  - Allow SetSocketHandle() to be called if Handle already set as socket
  - added strlcase() method to convert string to lower case
  - Update Handle structure:
    - renamed Address -> HostName
    - renamed PortNo -> PortName
    - added AddressList for all resolved addresses
    - added AddressInfo for active address
  - Add ResolveAddress() method
    - Domain name and protocol port resolving with GetAddrInfo()
  - JSON updated:
    - domain name can be provided instead of IP address
    - protocol can be specified instead of Port No, e.g. "HTTP" / "SSH"
  - Resolve address before connect, or use next resolved address
2017-07-22 09:40:17 +02:00

48 lines
1.4 KiB
C++

/*
* LogCore.h
*
* Created on: 17 May 2016
* Author: wentzelc
*/
#ifndef REDACORE_LOGCORE_H_
#define REDACORE_LOGCORE_H_
// redA Libraries
/* none */
// Standard C/C++ Libraries
#include <stdio.h>
//---------------------------------------------------------------------------
// Debug options
const short
OUT_COUNT = 1, // Show Length of String
OUT_NORMAL = 2, // Show ASCII output (replace non-printable characters (incl. CR/LF with ".")
OUT_HEX = 4, // Show HEX output
OUT_BIN = 8, // Show BINARY output
OUT_CRLF = 16, // with OUT_NORMAL - do not replace CR/LF with "."
OUT_ASIS = 32; // with OUT_NORMAL - do not replace any non-printable character with "."
//---------------------------------------------------------------------------
typedef enum { dlNone = 0, dlLow = 1, dlMedium = 2, dlHigh = 3 } EDebugLevel;
//---------------------------------------------------------------------------
class CLogCore
{
private:
FILE * OutputFile;
public:
CLogCore( FILE * pOutputFile );
bool Message( EDebugLevel DebugLevel, EDebugLevel MsgLevel, const char * Format, ... );
bool Output( EDebugLevel DebugLevel, EDebugLevel MsgLevel, const short Show, const char * Buffer, int Len, const char * Format, ... );
};
//---------------------------------------------------------------------------
#endif /* REDACORE_OGCORE_H_ */