VR-Forces 4.1 Class Documentation
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 
31  {
32  public:
33 
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 
63  {
64  if(levelWillPrint(level))
65  return *myOutput;
66  else
67  return *myEmptyOutput;
68  }
69 
71  DtOutputStream* outputStream();
72 
73  protected:
75  std::ostream* myOutput;
76  int myRef;
77  std::ostream* myEmptyOutput;
78  };
79 }

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)