fw4spl
ProgressToLogger.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2015.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #include "fwTools/ProgressToLogger.hpp"
8 
9 #include <fwCore/base.hpp>
10 
11 namespace fwTools
12 {
13 
14 ProgressToLogger::ProgressToLogger(std::string prefix, std::string postfix) : m_prefix(prefix),
15  m_postfix(postfix)
16 {
17 }
18 
20 {
21  // TODO Auto-generated destructor stub
22 }
23 
24 
25 void ProgressToLogger::operator()(float percent,std::string msg)
26 {
27  // fixme io precision
28  OSLM_INFO( m_prefix << msg << " " << (int) (percent*100) << m_postfix);
29 }
30 
31 }
FWTOOLS_API void operator()(float percent, std::string msg)
the handler effective code : send formated progress information to the log system SpyLog...
The namespace fwTools contains several tools like UUID, factory, dispatche, stringizer, macros, helper.
#define OSLM_INFO(message)
Definition: spyLog.hpp:252
FWTOOLS_API ProgressToLogger(std::string prefix, std::string postfix=" %")
constructor : define an output to log system as : [prefix] message percent [postfix] ...
virtual FWTOOLS_API ~ProgressToLogger()
default destructor, do nothing