logog
logger optimized for games
formatter.hpp
Go to the documentation of this file.
1 
5 #ifndef __LOGOG_FORMATTER_HPP__
6 #define __LOGOG_FORMATTER_HPP__
7 
8 namespace logog
9 {
11 class TimeStamp : public Object
12 {
13 public:
18  const char *Get(const char *fmt=LOGOG_DEFAULT_TIME_FORMAT);
19 
20 protected:
22 };
23 
25 class Formatter : public Object
26 {
27 public:
28  Formatter();
29 
34  virtual LOGOG_STRING &Format( const Topic &topic, const Target &target ) = 0;
35 
39  virtual void RenderTimeOfDay();
40 
51  virtual TOPIC_FLAGS GetTopicFlags( const Topic &topic );
52 
54  bool GetShowTimeOfDay() const;
55 
59  void SetShowTimeOfDay(bool val);
60 
61 #ifndef LOGOG_UNICODE
62 
66  void SetTimeOfDayFormat( const char *fmt );
67 #endif
68 
69 protected:
70  const LOGOG_CHAR *ErrorDescription( const LOGOG_LEVEL_TYPE level );
71 
74 
76 
77 #ifndef LOGOG_UNICODE
78  char m_TimeOfDayFormat[LOGOG_TIME_FORMAT_MAX];
79 #endif
80 
81 };
82 
83 class FormatterGCC : public Formatter
84 {
85 public:
86  virtual LOGOG_STRING &Format( const Topic &topic, const Target &target );
87 
88 };
89 
90 class FormatterMSVC : public Formatter
91 {
92 public:
93  virtual LOGOG_STRING &Format( const Topic &topic, const Target &target );
94 };
95 
97 extern void DestroyDefaultFormatter();
98 
99 }
100 
101 #endif // __LOGOG_FORMATTER_HPP_
char cTimeString[LOGOG_TIME_STRING_MAX]
Definition: formatter.hpp:21
[Thread]
Definition: api.hpp:8
Definition: target.hpp:16
#define LOGOG_STRING
Definition: string.hpp:113
int TOPIC_FLAGS
[Topic Bits]
Definition: const.hpp:85
bool GetShowTimeOfDay() const
Formatter & GetDefaultFormatter()
#define LOGOG_LEVEL_TYPE
[Level Constants]
Definition: const.hpp:56
bool m_bShowTimeOfDay
Definition: formatter.hpp:75
virtual void RenderTimeOfDay()
wchar_t LOGOG_CHAR
Definition: string.hpp:14
Definition: formatter.hpp:11
Definition: formatter.hpp:25
void DestroyDefaultFormatter()
const char * Get(const char *fmt=LOGOG_DEFAULT_TIME_FORMAT)
#define LOGOG_DEFAULT_TIME_FORMAT
Definition: const.hpp:30
void SetShowTimeOfDay(bool val)
virtual TOPIC_FLAGS GetTopicFlags(const Topic &topic)
Definition: formatter.hpp:83
LOGOG_STRING m_sIntBuffer
Definition: formatter.hpp:73
virtual LOGOG_STRING & Format(const Topic &topic, const Target &target)=0
virtual LOGOG_STRING & Format(const Topic &topic, const Target &target)
Definition: object.hpp:47
#define LOGOG_TIME_FORMAT_MAX
Definition: const.hpp:25
Definition: formatter.hpp:90
const LOGOG_CHAR * ErrorDescription(const LOGOG_LEVEL_TYPE level)
Definition: topic.hpp:15
LOGOG_STRING m_sMessageBuffer
Definition: formatter.hpp:72
virtual LOGOG_STRING & Format(const Topic &topic, const Target &target)
#define LOGOG_TIME_STRING_MAX
Definition: const.hpp:20