VR-Forces Development_Version Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
vrvUtil
DtDebugLog.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2007 MAK Technologies, Inc.
3
** All rights reserved.
4
******************************************************************************/
5
/******************************************************************************
6
** $RCSfile: DtDebugLog.h,v $ $Revision: 1.21 $ $State: Exp $
7
******************************************************************************/
8
12
13
#pragma once
14
#include <
vrvUtil/vrvUtil.h
>
15
#include <vlutil/vlExceptions.h>
16
#include <ostream>
17
18
class
DtOutputStream;
19
20
namespace
makVrv
21
{
22
#define DT_LOG_WARN log().out(DtDebugLog::Warning)<<"<Warning:"<<__DtFUNC__<<">"<<std::endl
23
#define DT_LOG_INFO log().out(DtDebugLog::Information)<<"<Info:"<<__DtFUNC__<<">"<<std::endl
24
#define DT_LOG_DEBUG log().out(DtDebugLog::Debug)<<"<Debug:"<<__DtFUNC__<<">"<<std::endl
25
#define DT_LOG_OUT log().out()
26
#define DT_LOG_LEVEL(a) log().levelWillPrint(a)
27
30
class
DT_DLL_VRVUTIL
DtDebugLog
31
{
32
public
:
33
34
enum
PrintLevel
35
{
36
Warning = 1,
37
Information = 2,
38
Debug = 4,
39
PrintLevel_End = 5
40
};
41
43
DtDebugLog
(DtOutputStream* output);
44
46
virtual
~
DtDebugLog
();
47
50
inline
bool
levelWillPrint(
DtDebugLog::PrintLevel
alevel)
51
{
52
return
level
() >= alevel;
53
}
54
56
virtual
void
setLevel(
DtDebugLog::PrintLevel
alevel);
57
59
virtual
void
setOutputStream(DtOutputStream* stream);
60
62
virtual
DtDebugLog::PrintLevel
level
();
63
65
inline
std::ostream& out(
DtDebugLog::PrintLevel
level
=
DtDebugLog::Information
)
66
{
67
if
(levelWillPrint(
level
))
68
return
*myOutput;
69
else
70
return
*myEmptyOutput;
71
}
72
74
DtOutputStream* outputStream();
75
76
protected
:
77
PrintLevel
myLevel
;
78
std::ostream*
myOutput
;
79
int
myRef
;
80
std::ostream*
myEmptyOutput
;
81
};
82
}
Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (
www.mak.com
)