00001 #ifndef LOCKED_LOGGER_CLASS 00002 #define LOCKED_LOGGER_CLASS 00003 00004 /*****************************************************************************\ 00005 * * 00006 * Name : locked_logger * 00007 * Author : Chris Koeritz * 00008 * * 00009 ******************************************************************************* 00010 * Copyright (c) 2002-$now By Author. This program is free software; you can * 00011 * redistribute it and/or modify it under the terms of the GNU General Public * 00012 * License as published by the Free Software Foundation; either version 2 of * 00013 * the License or (at your option) any later version. This is online at: * 00014 * http://www.fsf.org/copyleft/gpl.html * 00015 * Please send any updates to: fred@gruntose.com * 00016 \*****************************************************************************/ 00017 00018 #ifndef OMIT_PROGRAM_WIDE_LOGGER 00019 00020 #include <basis/log_base.h> 00021 #include <basis/locked_object.h> 00022 00024 00031 class locked_logger : public log_base, public locked_object<log_base> 00032 { 00033 public: 00034 locked_logger(log_base *the_logger = NIL); 00036 00037 virtual ~locked_logger(); 00038 00039 IMPLEMENT_CLASS_NAME("locked_logger"); 00040 00041 bool established(); 00043 00045 // overrides all log_base functionality and re-routes it to the real object. 00046 virtual void add_filter(int new_filter); 00047 virtual void remove_filter(int old_filter); 00048 virtual bool member(int filter_to_check); 00049 virtual void clear_filters(); 00050 virtual int_set filter_set(); 00051 virtual line_ending eol(); 00052 virtual void eol(line_ending to_set); 00053 virtual istring get_ending(); 00054 virtual void get_ending(istring &to_end); 00055 virtual outcome log(const istring &info, int filter = ALWAYS_PRINT); 00056 00057 private: 00058 // not supported. 00059 locked_logger(const locked_logger &); 00060 locked_logger &operator =(const locked_logger &); 00061 }; 00062 00063 #endif // OMIT_PROGRAM_WIDE_LOGGER 00064 00065 #endif // outer guard. 00066
1.5.1