myLog copy 2 - buffer all log messages LEVEL_1 buffer Level...

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&); myLog(const string&,enum logLevels); virtual ~myLog(); private: p void initVars(); void init(const string&); void init(const string&,int); void init(); char* getExecTime(); void getExecTime(int*,int*); void openLog(const string&,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

This note was uploaded on 03/27/2011 for the course COMPUTER 101 taught by Professor Bobthebuilder during the Spring '11 term at Columbia College.

Page1 / 2

myLog copy 2 - buffer all log messages LEVEL_1 buffer Level...

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