Subversion Repositories libraries.mycontrols

Rev

Rev 6 | Blame | Compare with Previous | Last modification | View Log

#pragma once


#include <stdio.h>
#include <stdarg.h>
#include <direct.h>
#include "nteventlogsource.h"

#define MAX_MSG 2048

#define TRACE_TEXT          0
#define TRACE_START         1
#define TRACE_STOP          2

class DbgView: public CObject
{
public:
  DbgView( void);
  DbgView( char *AppName);
  ~DbgView( void);
  DbgView( const DbgView &obj); //copy constructor

  void CodeTrace( char *codetracetext, int level, int event, int type,
                  char *bin, int binlen, ...);
    
  int GetTraceLevel( void) {return m_iDebugLevel;}
  void SetTraceLevel( int level) {m_iDebugLevel = level;}

  int GetLog2DbgViewer( void) {return m_iLog2DebugViewer;}
  int GetLog2Screen( void) {return m_iLog2Screen;}
  int GetLog2File( void) {return m_iLog2File;}
  int GetLog2EventViewer( void) {return m_iLog2EventViewer;}

  void SetLog2DbgViewer( int onoff) {m_iLog2DebugViewer = onoff;}
  void SetLog2Screen( int onoff) {m_iLog2Screen = onoff;}
  void SetLog2File( int onoff) {m_iLog2File = onoff;}
  void SetLog2EventViewer( int onoff) {m_iLog2EventViewer = onoff;}

  void SetEventLogging( char *AppName);

private:
  int m_iFirstCodeTrace;           //first codetrace empties log file
  CString m_sCommandLine;                 //command line of the task
  CString m_sIniFile;                     //ini file name, including directory
  CString m_sIniFileApp;                  //ini file located in the application dir
  int m_iLog2File;                 //enable debug logging to file
  int m_iLog2EventViewer;          //enable logging to event viewer
  int m_iLog2Screen;               //enable logging to cmd window
  int m_iLog2DebugViewer;          //enable logging to standard debugger
  int m_iDebugLevel;               //debug level 1 .. 4
  CString m_sLogFile;              //log file name, including directory

  static CNTEventLogSource *EventLog;

  int Log2EventViewer( int Type, char *msg);
  int m_iCopy;
};