GestureRecognitionToolkit  Version: 0.2.5
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
InfoLog.cpp
1 /*
2 GRT MIT License
3 Copyright (c) <2012> <Nicholas Gillian, Media Lab, MIT>
4 
5 Permission is hereby granted, free of charge, to any person obtaining a copy of this software
6 and associated documentation files (the "Software"), to deal in the Software without restriction,
7 including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
9 subject to the following conditions:
10 
11 The above copyright notice and this permission notice shall be included in all copies or substantial
12 portions of the Software.
13 
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15 LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
18 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 */
20 
21 #define GRT_DLL_EXPORTS
22 #include "InfoLog.h"
23 
24 GRT_BEGIN_NAMESPACE
25 
26 //Base log functions
27 bool Log::baseLoggingEnabled = true;
28 void Log::setProceedingText(std::string proceedingText){ setKey( proceedingText ); } //Legacy
29 std::string Log::getProceedingText() const{ return key; } //Legacy
30 bool Log::setEnableInstanceLogging(const bool loggingEnabled){ return setInstanceLoggingEnabled( loggingEnabled ); } //Legacy
31 
32 #ifdef GRT_CXX11_ENABLED
33 std::mutex Log::logMutex;
34 #endif
35 
36 //Info log functions
37 bool InfoLog::infoLoggingEnabled = true;
38 ObserverManager< InfoLogMessage > InfoLog::observerManager;
39 
40 bool InfoLog::enableLogging(bool loggingEnabled){
41  infoLoggingEnabled = loggingEnabled;
42  return infoLoggingEnabled;
43 }
44 
45 bool InfoLog::registerObserver(Observer< InfoLogMessage > &observer){
46  observerManager.registerObserver( observer );
47  return true;
48 }
49 
50 bool InfoLog::removeObserver(Observer< InfoLogMessage > &observer)
51 {
52  return observerManager.removeObserver(observer);
53 }
54 
55 bool InfoLog::loggingEnabled() const { return infoLoggingEnabled; } //Legacy
56 
57 GRT_END_NAMESPACE
std::string key
The key that will be written at the start of each log.
Definition: Log.h:219
static bool baseLoggingEnabled
This controls logging across all Log instances, as opposed to a single instance.
Definition: Log.h:228
virtual bool setKey(const std::string &key)
sets the key that gets written at the start of each message, this will be written in the format &#39;key ...
Definition: Log.h:166
virtual bool setInstanceLoggingEnabled(const bool loggingEnabled)
sets if logging is enabled for this specific instance
Definition: Log.h:201