2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-11 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #include "juce_StandardHeader.h"
30 #include "juce_Logger.h"
33 //==============================================================================
42 //==============================================================================
43 Logger
* Logger::currentLogger
= nullptr;
45 void Logger::setCurrentLogger (Logger
* const newLogger
,
46 const bool deleteOldLogger
)
48 Logger
* const oldLogger
= currentLogger
;
49 currentLogger
= newLogger
;
55 void Logger::writeToLog (const String
& message
)
57 if (currentLogger
!= nullptr)
58 currentLogger
->logMessage (message
);
60 outputDebugString (message
);
63 #if JUCE_LOG_ASSERTIONS
64 void JUCE_API
juce_LogAssertion (const char* filename
, const int lineNum
) noexcept
66 String
m ("JUCE Assertion failure in ");
67 m
<< filename
<< ", line " << lineNum
;
69 Logger::writeToLog (m
);