Skip to content
Snippets Groups Projects
Commit f738cbd9 authored by Lars Bilke's avatar Lars Bilke
Browse files

Set a custom logog formatter for the GUI which suppresses file name and line number.

parent 64fb38ab
No related branches found
No related tags found
No related merge requests found
/**
* Copyright (c) 2012, OpenGeoSys Community (http://www.opengeosys.com)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.com/LICENSE.txt
*
*
* \file LogogSimpleFormatter.h
*
* Created on 2012-09-13 by Lars Bilke
*/
#ifndef LOGOGSIMPLEFORMATTER_H
#define LOGOGSIMPLEFORMATTER_H
// ** INCLUDES **
#include "logog.hpp"
namespace BaseLib {
/**
* \brief LogogSimpleFormatter strips file name and line number from logog output.
* See http://johnwbyrd.github.com/logog/customformatting.html for details.
**/
class LogogSimpleFormatter : public logog::FormatterMSVC
{
virtual TOPIC_FLAGS GetTopicFlags( const logog::Topic &topic )
{
return ( logog::Formatter::GetTopicFlags( topic ) &
~( TOPIC_FILE_NAME_FLAG | TOPIC_LINE_NUMBER_FLAG ));
}
};
#endif // LOGOGSIMPLEFORMATTER_H
} // namespace BaseLib
\ No newline at end of file
......@@ -5,6 +5,7 @@
#include <OpenSG/OSGBaseFunctions.h>
#endif
#include "logog.hpp"
#include "LogogSimpleFormatter.h"
int main(int argc, char* argv[])
{
......@@ -13,6 +14,8 @@ int main(int argc, char* argv[])
#endif
LOGOG_INITIALIZE();
logog::Cout* logogCout = new logog::Cout;
BaseLib::LogogSimpleFormatter formatter;
logogCout->SetFormatter(formatter);
QApplication a(argc, argv);
setlocale(LC_NUMERIC,"C");
MainWindow* w = new MainWindow();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment