head 1.4; access; symbols; locks; strict; comment @# @; 1.4 date 2002.09.07.01.50.38; author curt; state Exp; branches; next 1.3; 1.3 date 2002.08.31.19.01.54; author curt; state Exp; branches; next 1.2; 1.2 date 2002.08.31.18.54.01; author curt; state Exp; branches; next 1.1; 1.1 date 2002.02.15.17.21.57; author curt; state Exp; branches; next ; desc @@ 1.4 log @Updated doxygen docs. @ text @
Main Page Class Hierarchy Compound List File List Compound Members File Members

# logstream.cxx

    00001 // Stream based logging mechanism.
    00002 //
    00003 // Written by Bernie Bright, 1998
    00004 //
    00005 // Copyright (C) 1998  Bernie Bright - bbright@@c031.aone.net.au
    00006 //
    00007 // This library is free software; you can redistribute it and/or
    00008 // modify it under the terms of the GNU Library General Public
    00009 // License as published by the Free Software Foundation; either
    00010 // version 2 of the License, or (at your option) any later version.
    00011 //
    00012 // This library 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 GNU
    00015 // Library General Public License for more details.
    00016 //
    00017 // You should have received a copy of the GNU Library General Public
    00018 // License along with this library; if not, write to the
    00019 // Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00020 // Boston, MA  02111-1307, USA.
    00021 //
    00022 // $Id: logstream.cxx,v 1.5 2002/05/10 21:33:12 david Exp $
    00023
    00024 #include "logstream.hxx"
    00025
    00026 logstream *global_logstream = NULL;
    00027
    00028 bool            logbuf::logging_enabled = true;
    00029 sgDebugClass    logbuf::logClass        = SG_NONE;
    00030 sgDebugPriority logbuf::logPriority     = SG_INFO;
    00031 streambuf*      logbuf::sbuf            = NULL;
    00032
    00033 logbuf::logbuf()
    00034 {
    00035 //     if ( sbuf == NULL )
    00036 //      sbuf = cerr.rdbuf();
    00037 }
    00038
    00039 logbuf::~logbuf()
    00040 {
    00041     if ( sbuf )
    00042             sync();
    00043 }
    00044
    00045 void
    00046 logbuf::set_sb( streambuf* sb )
    00047 {
    00048     if ( sbuf )
    00049             sync();
    00050
    00051     sbuf = sb;
    00052 }
    00053
    00054 void
    00055 logbuf::set_log_level( sgDebugClass c, sgDebugPriority p )
    00056 {
    00057     logClass = c;
    00058     logPriority = p;
    00059 }
    00060
    00061 void
    00062 logbuf::set_log_classes (sgDebugClass c)
    00063 {
    00064     logClass = c;
    00065 }
    00066
    00067 sgDebugClass
    00068 logbuf::get_log_classes ()
    00069 {
    00070     return logClass;
    00071 }
    00072
    00073 void
    00074 logbuf::set_log_priority (sgDebugPriority p)
    00075 {
    00076     logPriority = p;
    00077 }
    00078
    00079 sgDebugPriority
    00080 logbuf::get_log_priority ()
    00081 {
    00082     return logPriority;
    00083 }
    00084
    00085 void
    00086 logstream::setLogLevels( sgDebugClass c, sgDebugPriority p )
    00087 {
    00088     logbuf::set_log_level( c, p );
    00089 }
    00090

@ 1.3 log @Oops, try again. @ text @d99 1 a99 1