Main Page | Namespace List | Alphabetical List | Class List | Directories | File List | Class Members | File Members

LogWriter.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   SpikeStream Library                                                   *
00003  *   Copyright (C) 2007 by David Gamez                                     *
00004  *   david@davidgamez.eu                                                   *
00005  *   Version 0.1                                                           *
00006  *                                                                         *
00007  *   This program is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU General Public License as published by  *
00009  *   the Free Software Foundation; either version 2 of the License, or     *
00010  *   (at your option) any later version.                                   *
00011  *                                                                         *
00012  *   This program is distributed in the hope that it will be useful,       *
00013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00015  *   GNU General Public License for more details.                          *
00016  *                                                                         *
00017  *   You should have received a copy of the GNU General Public License     *
00018  *   along with this program; if not, write to the                         *
00019  *   Free Software Foundation, Inc.,                                       *
00020  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00021  ***************************************************************************/
00022 
00023 #ifndef LOGWRITER_H
00024 #define LOGWRITER_H
00025 
00026 //Other includes
00027 #include <fstream>
00028 using namespace std;
00029 
00030 
00031 //---------------------------- Log Writer ----------------------------------
00032 /*! Collection of static methods that control logging for the application.
00033         Logging can operate at three levels:
00034         
00035                 0 - disabled
00036                 1 - medium. Logs only some database transactions
00037                 2 - full. Complete record of changes to the database
00038                 
00039         Logging is disabled by SpikeStreamMainWindow at start up if the log file 
00040         is too large. The maximum size of log file is set in 
00041         SpikeStreamApplication.config. This class is not currently used, but is 
00042         available if needed. */
00043 //---------------------------------------------------------------------------
00044 
00045 class LogWriter {
00046 
00047         public:
00048                 static void addLog(char*);
00049                 static void addLog(char*, char*);
00050                 static void addLog(const char*, const char*);
00051                 static void addLog(string);
00052                 static void addLog(string, string);
00053                 static void disableLogging();
00054                 static int getLogLevel();
00055                 static bool loggingEnabled();
00056                 static void setLogLevel(int logLevel);
00057                 static void setLogPath(const char*);
00058                 static void writeDate();
00059 
00060 
00061         private:
00062                 /*! The amount of logging used. */
00063                 static int logLevel;
00064 
00065                 /*! Location f the log output file. */
00066                 static char logPath [255];
00067 
00068 };
00069 
00070 
00071 #endif//LOGWRITER_H
00072 

Generated on Mon Sep 3 22:18:50 2007 for SpikeStream Library by  doxygen 1.4.4