VR-Forces 4.3 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
DtDebugLog::PrintLevel
level
();
60
62
inline
std::ostream& out(
DtDebugLog::PrintLevel
level
=
DtDebugLog::Information
)
63
{
64
if
(levelWillPrint(
level
))
65
return
*myOutput;
66
else
67
return
*myEmptyOutput;
68
}
69
71
DtOutputStream
* outputStream();
72
73
protected
:
74
PrintLevel
myLevel
;
75
std::ostream*
myOutput
;
76
int
myRef
;
77
std::ostream*
myEmptyOutput
;
78
};
79
}
Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (
www.mak.com
)