VR-Forces 4.6.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
vrvUtil
DtDebugLog.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2017 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/vlPrint.h>
16
#include <vlutil/vlExceptions.h>
17
#include <ostream>
18
19
namespace
makVrv
20
{
21
#define DT_LOG_WARN log().out(DtDebugLog::Warning)<<"Warning: " << __FILE__ << " +" << __LINE__ << " " << __FUNCTION__ << ": "
22
#define DT_LOG_INFO log().out(DtDebugLog::Information)<<"Info: " <<__FILE__ << " +" << __LINE__ << " " << __FUNCTION__ << ": "
23
#define DT_LOG_DEBUG log().out(DtDebugLog::Debug)<<"Debug: "<< __FILE__ << " +" << __LINE__ << " " << __FUNCTION__ << ": "
24
#define DT_LOG_OUT log().out()
25
#define DT_LOG_LEVEL(a) log().levelWillPrint(a)
26
40
class
DT_DLL_VRVUTIL
DtDebugLog
41
{
42
public
:
43
44
enum
PrintLevel
45
{
46
Warning = 1,
47
Information = 2,
48
Debug = 4,
49
PrintLevel_End = 5
50
};
51
53
DtDebugLog
(
const
std::string&
filename
);
54
56
virtual
~
DtDebugLog
();
57
60
inline
bool
levelWillPrint(
DtDebugLog::PrintLevel
alevel)
61
{
62
return
level
() >= alevel;
63
}
64
66
virtual
void
setLevel(
DtDebugLog::PrintLevel
alevel);
67
69
virtual
void
setOutputStream(DtOutputStream*
stream
);
70
72
virtual
DtDebugLog::PrintLevel
level
();
73
75
inline
std::ostream& out(
DtDebugLog::PrintLevel
level
=
DtDebugLog::Information
)
76
{
77
if
(levelWillPrint(
level
))
78
return
*myOutput;
79
else
80
return
*myEmptyOutput;
81
}
82
84
DtOutputStream* outputStream();
85
86
protected
:
89
PrintLevel
myLevel
;
90
92
DtFilePrinter*
myFilePrinter
;
93
95
DtOutputStreamBuffer*
myBuffer
;
96
98
DtOutputStreamBuffer*
myEmptyBuffer
;
99
104
int
myPrintLevelThresholdRef
;
105
109
DtOutputStream*
myOutput
;
110
114
std::ostream*
myEmptyOutput
;
115
};
116
}
Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (
www.mak.com
)