Phasor
01.00.10.059
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
Phasor
Phasor
GameLogging.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
ThreadedLogging.h
"
4
5
// These are encoded as 8 bit numbers
6
// xxxx xxxx
7
// type event
8
// Where type is Game, Player etc and event is the specific event (join, leave etc)
9
10
enum
glog_type
11
{
12
kGameEnd
= 1 << 4,
13
kGameStart
,
14
kPlayerJoin
= (1 << 5) + 2,
15
kPlayerLeave
,
16
kPlayerChange
,
17
kPlayerDeath
,
18
kPlayerChat
,
19
kServerCommand
= (1 << 6) + 6,
20
kServerClose
,
21
kScriptEvent
= (1 << 7) + 8
22
};
23
24
class
CGameLog
25
{
26
private
:
27
std::unique_ptr<CThreadedLogging> logstream;
28
static
const
unsigned
int
kSaveDelay = 10000;
// 10 seconds
29
30
public
:
31
CGameLog
(
const
std::wstring& dir,
const
std::wstring& file,
32
PhasorThread
& thread);
33
34
// linebreak is automatically added
35
void
WriteLog
(
glog_type
type,
wchar_t
* format, ...);
36
void
WriteLog
(
glog_type
type,
char
* format, ...);
37
38
CLoggingStream
&
GetLogStream
() {
return
*logstream; }
39
};
Generated on Mon Jul 22 2013 17:09:01 for Phasor by
1.8.2-20121118