1 /******************************************************************************
2 * Arachnoid Graphics Plugin for Mupen64Plus
3 * http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
5 * Copyright (C) 2009 Jon Ring
6 * Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 *****************************************************************************/
25 //-----------------------------------------------------------------------------
27 //! Initializes log with debug callback
28 //-----------------------------------------------------------------------------
29 bool Logger::initialize(void (*debugCallback)(void*, int, const char*), void *context)
31 m_debugCallback = debugCallback;
32 m_debugCallContext = context;
37 //-----------------------------------------------------------------------------
39 //-----------------------------------------------------------------------------
45 //-----------------------------------------------------------------------------
48 //-----------------------------------------------------------------------------
49 void Logger::dispose()
51 m_debugCallback = NULL;
52 m_debugCallContext = NULL;
55 //-----------------------------------------------------------------------------
57 //! Writes a message to log-file and/or console.
58 //! @param msg The text message to write to log-file.
59 //! @param lml How important the message is. Error message are more important then warnings for example.
60 //-----------------------------------------------------------------------------
61 void Logger::printMsg(const char* msg, m64p_msg_level lml)
63 if (m_debugCallback != NULL)
65 (*m_debugCallback)(m_debugCallContext, lml, msg);