]> git.sesse.net Git - vlc/blob - modules/gui/skins2/src/logger.hpp
* all: brand new skins interface ( still _experimental_) for x11 and
[vlc] / modules / gui / skins2 / src / logger.hpp
1 /*****************************************************************************
2  * logger.hpp
3  *****************************************************************************
4  * Copyright (C) 2003 VideoLAN
5  * $Id: logger.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
6  *
7  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
8  *          Olivier Teulière <ipkiss@via.ecp.fr>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
23  *****************************************************************************/
24
25 #ifndef LOGGER_HPP
26 #define LOGGER_HPP
27
28 #include "skin_common.hpp"
29 #include <string>
30
31
32 // helper macros
33 #define MSG_ERR( msg ) Logger::instance( getIntf() )->error( msg )
34 #define MSG_WARN( msg ) Logger::instance( getIntf() )->warn( msg )
35
36
37 // Logger class
38 class Logger: public SkinObject
39 {
40     public:
41         /// Get the instance of Logger
42         /// Returns NULL if initialization failed
43         static Logger *instance( intf_thread_t *pIntf );
44
45         /// Delete the instance of Logger
46         static void destroy( intf_thread_t *pIntf );
47
48         /// Print an error message
49         void error( const string &rMsg );
50
51         /// Print a warning
52         void warn( const string &rMsg );
53
54     private:
55         // Private because it's a singleton
56         Logger( intf_thread_t *pIntf );
57         ~Logger();
58 };
59
60
61 #endif