Main Page Class Hierarchy Compound List File List Compound Members

# SimpleFileLogger.h

    00001 #ifndef LOG_H
    00002 #define LOG_H
    00003
    00004 #include <fstream>
    00005 using namespace std;
    00006
    00007 //ofstream examplefile ("example.txt");
    00008
    00009 class SimpleFileLogger
    00010 {
    00011 public:
    00012
    00013         SimpleFileLogger();
    00014         SimpleFileLogger(char * filename);
    00015
    00016         static int log(const char * className, char * message);
    00017
    00018         static void close()
    00019         {
    00020                 logfile.close();
    00021         }
    00022
    00023         static void open(char * filename)
    00024         {
    00025                 logfile.open (filename, ios::out | ios::app );
    00026         }
    00027
    00028 private:
    00029         static ofstream logfile;
    00030
    00031 };
    00032
    00033 #endif