TuttleOFX  1
ofxsLog.h
Go to the documentation of this file.
00001 #ifndef _ofxsLog_H_
00002 #define _ofxsLog_H_
00003 /*
00004  * OFX Support Library, a library that skins the OFX plug-in API with C++ classes.
00005  * Copyright (C) 2004-2005 The Open Effects Association Ltd
00006  * Author Bruno Nicoletti bruno@thefoundry.co.uk
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted provided that the following conditions are met:
00010  *
00011  * Redistributions of source code must retain the above copyright notice,
00012  * this list of conditions and the following disclaimer.
00013  * Redistributions in binary form must reproduce the above copyright notice,
00014  * this list of conditions and the following disclaimer in the documentation
00015  * and/or other materials provided with the distribution.
00016  * Neither the name The Open Effects Association Ltd, nor the names of its
00017  * contributors may be used to endorse or promote products derived from this
00018  * software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00021  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00022  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00023  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
00024  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00025  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00026  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
00027  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00028  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00029  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00030  *
00031  * The Open Effects Association Ltd
00032  * 1 Wardour St
00033  * London W1D 6PA
00034  * England
00035  *
00036  *
00037  *
00038  */
00039 
00040 /** @file This file contains OFX logging header code
00041  */
00042 
00043 /** @brief The core 'OFX Support' namespace, used by plugin implementations. All code for these are defined in the common support libraries.
00044  */
00045 namespace OFX {
00046 
00047 /** @brief this namespace wraps up logging functionality */
00048 namespace Log {
00049 /** @brief Indent it, not MP sane at the moment */
00050 void indent( void );
00051 
00052 /** @brief Outdent it, not MP sane at the moment */
00053 void outdent( void );
00054 
00055 /** @brief Sets the name of the log file. */
00056 void setFileName( const std::string& value );
00057 
00058 /** @brief Opens the log file, returns whether this was sucessful or not. */
00059 bool open( void );
00060 
00061 /** @brief Closes the log file. */
00062 void close( void );
00063 
00064 /** @brief Prints to the log file. */
00065 void print( const char* format, ... );
00066 
00067 /** @brief Prints to the log file only if the condition is true and prepends a warning notice. */
00068 void warning( bool condition, const char* format, ... );
00069 
00070 /** @brief Prints to the log file only if the condition is true and prepends an error notice. */
00071 void error( bool condition, const char* format, ... );
00072 };
00073 };
00074 
00075 #endif