annotate CollidoscopeApp/src/Log.cpp @ 18:f1ff1a81be20 tip

Changed licenses names. Fixed one comment and usage text in CollidoscopeApp.cpp.
author Fiore Martin <f.martin@qmul.ac.uk>
date Thu, 25 Aug 2016 12:07:50 +0200
parents 75b744078d66
children
rev   line source
f@5 1 /*
f@5 2
f@5 3 Copyright (C) 2016 Queen Mary University of London
f@5 4 Author: Fiore Martin
f@5 5
f@5 6 This file is part of Collidoscope.
f@5 7
f@5 8 Collidoscope is free software: you can redistribute it and/or modify
f@5 9 it under the terms of the GNU General Public License as published by
f@5 10 the Free Software Foundation, either version 3 of the License, or
f@5 11 (at your option) any later version.
f@5 12
f@5 13 This program is distributed in the hope that it will be useful,
f@5 14 but WITHOUT ANY WARRANTY; without even the implied warranty of
f@5 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f@5 16 GNU General Public License for more details.
f@5 17
f@5 18 You should have received a copy of the GNU General Public License
f@5 19 along with this program. If not, see <http://www.gnu.org/licenses/>.
f@5 20 */
f@5 21
f@0 22
f@0 23 #include "cinder/Log.h"
f@0 24
f@0 25 bool fileLoggerCreated = false;
f@0 26
f@0 27 void logError( const std::string &errorMsg )
f@0 28 {
f@0 29 using namespace ci::log;
f@0 30
f@0 31 if ( !fileLoggerCreated ){
f@0 32 makeLogger<ci::log::LoggerFile>( "./collidoscope_error.log" );
f@0 33 fileLoggerCreated = true;
f@0 34 }
f@0 35
f@0 36 LogManager *log = LogManager::instance();
f@0 37
f@0 38 Metadata logMeta;
f@0 39 logMeta.mLevel = LEVEL_ERROR;
f@0 40
f@0 41 log->write( logMeta, errorMsg );
f@0 42
f@0 43 }
f@0 44
f@0 45 void logInfo( const std::string &infoMsg )
f@0 46 {
f@0 47 #ifdef _DEBUG
f@0 48 using namespace ci::log;
f@0 49
f@0 50 LogManager *log = LogManager::instance();
f@0 51
f@0 52 Metadata logMeta;
f@0 53 logMeta.mLevel = LEVEL_INFO;
f@0 54
f@0 55 log->write( logMeta, infoMsg );
f@0 56 #endif
f@0 57 }