myLog copy 2 - // buffer all log messages LEVEL_1, //...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
//-*-C++-*-/////////////////////////////////////////////////////////////////// // Copyright 2004 yuChen Technology. All Rights Reserved. // // Class: myLog // // Description: used as a system log file for the simDelta project // // Name of Designer: Liyang Yu // Name of Coder: Liyang Yu // Date: 01/27/04 // ////////////////////////////////////////////////////////////////////////////// / #ifndef myLog_H #define myLog_H 1 # #include <fstream> #include <iostream> #include <string> #include <time.h> using namespace std; u /* the log file has to be accessed from any code which includes this header (similiar to cout, cerr, clog, etc. .) */ * class myLog; extern myLog winLog; e // const string SD_DEFAULT_LOGFILE = "simDelta.log"; / const int LOG_WRITE = ios::out; const int LOG_APPEND = ios::app; c const int EXIT_MSG_SIZE = 512; const int MAX_EXIT_CODES = 3; c class myLog : public ofstream { public: p enum logLevels { LEVEL_0,
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: // buffer all log messages LEVEL_1, // buffer Level one, two and three log messages LEVEL_2, // buffer Level two and three log messages LEVEL_3, // buffer Level three log messages QUIET_MODE // do not print out any messages }; myLog(); myLog(const string&amp;); myLog(const string&amp;,enum logLevels); virtual ~myLog(); private: p void initVars(); void init(const string&amp;); void init(const string&amp;,int); void init(); char* getExecTime(); void getExecTime(int*,int*); void openLog(const string&amp;,int); void printHeader(int); private: p string logName; enum logLevels logLevel; time_t startTime; }; } const enum myLog::logLevels L0 = myLog::LEVEL_0; const enum myLog::logLevels L1 = myLog::LEVEL_1; const enum myLog::logLevels L2 = myLog::LEVEL_2; const enum myLog::logLevels L3 = myLog::LEVEL_3; const enum myLog::logLevels LQUIET = myLog::QUIET_MODE; c #endif #...
View Full Document

Page1 / 2

myLog copy 2 - // buffer all log messages LEVEL_1, //...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online