Rise
The Vieneo Province
Toggle main menu visibility
Loading...
Searching...
No Matches
Logger.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <string>
4
#include <memory>
5
#include <cstdint>
6
#include "
CrashBreadcrumbs.h
"
7
8
class
Networking
;
9
10
class
Logger
11
{
12
struct
CrashState
;
13
std::unique_ptr<CrashState>
crash
;
14
Networking
*
networking
=
nullptr
;
15
char
fileName
[99] = { 0 };
16
CrashBreadcrumbs
breadcrumbs
;
17
18
static
void
RemoveOldFiles
(
const
wchar_t
* searchkey,
int
maxDays);
19
std::uint32_t
QueueTraceFile
(
bool
requestReceipt)
const
;
20
21
public
:
22
enum
Level
23
{
24
None
= -1,
25
Info
= 0,
26
Warn
= 1,
27
Debug
= 2,
28
Error
= 3,
29
Fatal
= 4
30
};
31
32
void
SendTraceFile
(
bool
waitForDelivery =
true
)
const
;
33
void
Log
(
const
char
* msg,
Level
level =
Info
,
int
errorCode = 0);
34
void
AddToCallStack
(
const
char
* msg);
35
void
SetNetworkingPointer
(
Networking
* prmNetworking);
36
void
SendPendingCrashReports
();
37
void
ConfirmTraceDelivery
(std::uint32_t receipt);
38
// Also used by SEH boundaries before /EHa can unwind away the native context.
39
static
long
__stdcall
HandleNativeException
(
struct
_EXCEPTION_POINTERS* exception);
40
void
RecordCrash
(
const
char
* reason,
unsigned
long
code = 0,
41
struct
_EXCEPTION_POINTERS* exception =
nullptr
) noexcept;
42
43
std::
string
lastError
;
44
Level
lastLevel
=
Level
::
None
;
45
int
lastErrorCode
= 0;
46
47
Logger
();
48
~
Logger
();
49
};
CrashBreadcrumbs.h
CrashBreadcrumbs
Definition
CrashBreadcrumbs.h:8
Logger::lastLevel
Level lastLevel
Definition
Logger.h:44
Logger::lastError
std::string lastError
Definition
Logger.h:43
Logger::Log
void Log(const char *msg, Level level=Info, int errorCode=0)
Definition
Logger.cpp:283
Logger::AddToCallStack
void AddToCallStack(const char *msg)
Definition
Logger.cpp:355
Logger::QueueTraceFile
std::uint32_t QueueTraceFile(bool requestReceipt) const
Definition
Logger.cpp:212
Logger::networking
Networking * networking
Definition
Logger.h:14
Logger::RemoveOldFiles
static void RemoveOldFiles(const wchar_t *searchkey, int maxDays)
Definition
Logger.cpp:364
Logger::SetNetworkingPointer
void SetNetworkingPointer(Networking *prmNetworking)
Definition
Logger.cpp:362
Logger::HandleNativeException
static long __stdcall HandleNativeException(struct _EXCEPTION_POINTERS *exception)
Definition
Logger.cpp:88
Logger::RecordCrash
void RecordCrash(const char *reason, unsigned long code=0, struct _EXCEPTION_POINTERS *exception=nullptr) noexcept
Definition
Logger.cpp:98
Logger::SendPendingCrashReports
void SendPendingCrashReports()
Definition
Logger.cpp:221
Logger::lastErrorCode
int lastErrorCode
Definition
Logger.h:45
Logger::SendTraceFile
void SendTraceFile(bool waitForDelivery=true) const
Definition
Logger.cpp:207
Logger::breadcrumbs
CrashBreadcrumbs breadcrumbs
Definition
Logger.h:16
Logger::crash
std::unique_ptr< CrashState > crash
Definition
Logger.h:13
Logger::ConfirmTraceDelivery
void ConfirmTraceDelivery(std::uint32_t receipt)
Definition
Logger.cpp:265
Logger::Logger
Logger()
Definition
Logger.cpp:392
Logger::Level
Level
Definition
Logger.h:23
Logger::None
@ None
Definition
Logger.h:24
Logger::Debug
@ Debug
Definition
Logger.h:27
Logger::Info
@ Info
Definition
Logger.h:25
Logger::Warn
@ Warn
Definition
Logger.h:26
Logger::Fatal
@ Fatal
Definition
Logger.h:29
Logger::Error
@ Error
Definition
Logger.h:28
Logger::fileName
char fileName[99]
Definition
Logger.h:15
Networking
Definition
Networking.h:74
Logger::CrashState
Definition
Logger.cpp:67
Logger.h
Generated on
for Rise by
1.18.0