forked from stuerp/foo_vis_spectrum_analyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLog.cpp
More file actions
54 lines (37 loc) · 919 Bytes
/
Log.cpp
File metadata and controls
54 lines (37 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/** $VER: Log.cpp (2024.03.09) P. Stuer **/
#include "framework.h"
#include "Log.h"
#include <CppCoreCheck/Warnings.h>
#pragma warning(disable: 4100 4625 4626 4710 4711 5045 ALL_CPPCORECHECK_WARNINGS)
#include <SDKDDKVer.h>
#define NOMINMAX
#include <helpers/foobar2000+atl.h>
#include <helpers/helpers.h>
#undef NOMINMAX
#include <strsafe.h>
#pragma hdrstop
namespace Log
{
#ifdef _DEBUG
static Level _Level = Level::Trace;
#else
static Level _Level = Level::Information;
#endif
/// <summary>
/// Writes a message to the console.
/// </summary>
void Write(Level logLevel, const char * format, ...) noexcept
{
if (logLevel < _Level)
return;
va_list va;
va_start(va, format);
console::printfv(format, va);
#ifdef _DEBUG
CHAR Text[256];
::vsprintf_s(Text, _countof(Text), format, va);
::OutputDebugStringA(Text); ::OutputDebugStringA("\n");
#endif
va_end(va);
}
}