/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */ /* $Id: cmnLogger.cpp,v 1.6 2007/04/26 19:33:56 anton Exp $ Author(s): Anton Deguet Created on: 2004-08-31 (C) Copyright 2004-2007 Johns Hopkins University (JHU), All Rights Reserved. --- begin cisst license - do not edit --- This software is provided "as is" under an open source license, with no warranty. The complete license can be found in license.txt and http://www.cisst.org/cisst/license.txt. --- end cisst license --- */ #include #include cmnLogger::cmnLogger(char* defaultLogFileName): LoD(10), // DefaultLogFile(defaultLogFileName), LoDMultiplexerStreambuf(/*DefaultLogFile*/) { LoDMultiplexerStreambuf.AddChannel(*(DefaultLogFile(defaultLogFileName)), 5); } std::ofstream* cmnLogger::DefaultLogFile(char * defaultLogFileName) { static std::ofstream defaultLogFile(defaultLogFileName); return &defaultLogFile; } cmnLogger* cmnLogger::Instance(void) { // create a static variable static cmnLogger instance; return &instance; } // **************************************************************************** // Change History // **************************************************************************** // // $Log: cmnLogger.cpp,v $ // Revision 1.6 2007/04/26 19:33:56 anton // All files in libraries: Applied new license text, separate copyright and // updated dates, added standard header where missing. // // Revision 1.5 2006/11/20 20:33:19 anton // Licensing: Applied new license to cisstCommon, cisstVector, cisstNumerical, // cisstInteractive, cisstImage and cisstOSAbstraction. // // Revision 1.4 2005/09/26 15:41:46 anton // cisst: Added modelines for emacs and vi. // // Revision 1.3 2005/05/19 19:29:01 anton // cisst libs: Added the license to cisstCommon and cisstVector // // Revision 1.2 2005/02/11 19:50:44 anton // cmnLogger: Added two methods to halt/resume the log to the default file. // // Revision 1.1 2004/09/01 21:12:02 anton // cisstCommon: Major update of the class register and the logging system. // The class register is now a singleton (as in "Design Patterns") and doesn't // store any information related to the logging (i.e. global lod, multiplexer // for the output). The data related to the log is now regrouped in the // singleton cmnLogger. This code is still fairly experimental (but tested) // and the documentation is missing. These changes should solve the tickets // #30, #38 and #46. // // // ****************************************************************************