00001 /* libradar_stp 00002 * <http://www.k9nl.net/radar/> <radar@k9nl.net> 00003 * 00004 * loghandler.h - log file handler class 00005 * 00006 * THIS FILE IS NOT MEANT FOR LIBRARY CLIENT USE 00007 * It is included in case it's helpful 00008 * 00009 * Copyright (C) 2007 Nicholas J. Luther 00010 * 00011 * This program is free software; you can redistribute it and/or 00012 * modify it under the terms of the GNU General Public License, 00013 * version 2, as published by the Free Software Foundation. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00023 * You may contact the author by writing to Nick Luther, 1655 South 00024 * Westhaven Drive, Oshkosh, Wisconsin 54904, USA. 00025 * 00026 */ 00027 00028 00029 00030 #ifndef _LIBRSTP_INC_LOGHANDLER_H 00031 #define _LIBRSTP_INC_LOGHANDLER_H 00032 00033 #include <string> 00034 00035 namespace libradar_stp { 00036 00037 class LogHandler { 00038 public: 00039 00040 LogHandler(); 00041 LogHandler( const LogHandler& log ); 00042 ~LogHandler(); 00043 00044 void initialize( std::string progid, std::string file, int level = 1 ); 00045 00046 void logEntry( const std::string& message, int level = 1 ); 00047 00048 std::string getTime() const; 00049 std::string mkString( int n ) const; 00050 00051 LogHandler& operator= ( const LogHandler& log ); 00052 00053 private: 00054 00055 std::string m_progid; 00056 std::string m_file; 00057 int m_level; 00058 00059 }; // class 00060 00061 }; // namespace 00062 00063 #endif
1.4.7