Mercurial > hg > opencollidoscope
diff CollidoscopeApp/src/Log.cpp @ 0:02467299402e
First import
CollidoscopeApp for Raspberry Pi
JackDevice
Teensy code for Collidoscope
author | Fiore Martin <f.martin@qmul.ac.uk> |
---|---|
date | Thu, 30 Jun 2016 14:50:06 +0200 |
parents | |
children | 75b744078d66 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CollidoscopeApp/src/Log.cpp Thu Jun 30 14:50:06 2016 +0200 @@ -0,0 +1,36 @@ + +#include "cinder/Log.h" + +bool fileLoggerCreated = false; + +void logError( const std::string &errorMsg ) +{ + using namespace ci::log; + + if ( !fileLoggerCreated ){ + makeLogger<ci::log::LoggerFile>( "./collidoscope_error.log" ); + fileLoggerCreated = true; + } + + LogManager *log = LogManager::instance(); + + Metadata logMeta; + logMeta.mLevel = LEVEL_ERROR; + + log->write( logMeta, errorMsg ); + +} + +void logInfo( const std::string &infoMsg ) +{ +#ifdef _DEBUG + using namespace ci::log; + + LogManager *log = LogManager::instance(); + + Metadata logMeta; + logMeta.mLevel = LEVEL_INFO; + + log->write( logMeta, infoMsg ); +#endif +}