TexGen
Logger.cpp
Go to the documentation of this file.
1/*=============================================================================
2TexGen: Geometric textile modeller.
3Copyright (C) 2006 Martin Sherburn
4
5This program is free software; you can redistribute it and/or
6modify it under the terms of the GNU General Public License
7as published by the Free Software Foundation; either version 2
8of the License, or (at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program; if not, write to the Free Software
17Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18=============================================================================*/
19
20#include "PrecompiledHeaders.h"
21#include "Logger.h"
22#include "TexGen.h"
23
24using namespace TexGen;
25CLogIndent::CLogIndent()
26{
28}
29
31{
33}
34
36: m_iIndent(0)
37{
38}
39
41{
42}
43
46void CLoggerScreen::TexGenError(std::string FileName, int iLineNumber, std::string Message)
47{
48 std::cerr << FileName << "(" << iLineNumber << ") : " << Message << std::endl;
49}
50
53void CLoggerScreen::TexGenLog(std::string FileName, int iLineNumber, std::string Message)
54{
55 int i;
56 for (i=0; i<m_iIndent; ++i)
57 std::cout << " ";
58 std::cout << Message << std::endl;
59}
60
61namespace TexGen
62{
64 {
65 return TEXGEN.GetLogger();
66 }
67}
68
69
70
71
72
73
74
75
76
#define TGLOGDECREASEINDENT()
Definition: Logger.h:60
#define TGLOGINCREASEINDENT()
Macros to increase and decrease indentation in the logging.
Definition: Logger.h:55
#define TEXGEN
Helper macro to get the texgen instance.
Definition: TexGen.h:76
Abstract base class to act as an interface between texgen and the logger.
Definition: Logger.h:85
CLogger(void)
Definition: Logger.cpp:35
virtual ~CLogger(void)
Definition: Logger.cpp:40
int m_iIndent
Definition: Logger.h:97
void TexGenLog(std::string FileName, int iLineNumber, std::string Message)
Definition: Logger.cpp:53
void TexGenError(std::string FileName, int iLineNumber, std::string Message)
Definition: Logger.cpp:46
Namespace containing a series of customised math operations not found in the standard c++ library.
CLogger & GetLogger()
Definition: Logger.cpp:63