Lib
QOLを高める
Classes | Namespaces | Macros | Functions
debug.h File Reference

Debug utilities. More...

#include "util.h"
#include "exceptions.h"

Go to the source code of this file.

Classes

class  yappy::debug::StopWatch
 Stop watch utility for performance measurement. More...
 

Namespaces

 yappy
 
 yappy::debug
 Debug utilities.
 
 yappy::trace
 On memory fast logging.
 

Macros

#define STR2WSTR0(s)   L ## s
 
#define STR2WSTR(s)   STR2WSTR0(s)
 
#define ASSERT(x)
 Assertion which uses debug framework. More...
 
#define ASSERT0(x, msg, sig, file, line)
 

Functions

bool yappy::debug::enableDebugOutput () noexcept
 Enables writing to OutputDebugString(). More...
 
bool yappy::debug::enableConsoleOutput () noexcept
 Shows a console window and enables writing to it. More...
 
bool yappy::debug::enableFileOutput (const wchar_t *fileName) noexcept
 Enables writing to a file. More...
 
void yappy::debug::shutdownDebugOutput () noexcept
 Flush buffers and free resources. More...
 
void yappy::debug::write (const wchar_t *str, bool newline=false) noexcept
 Write debug string. More...
 
void yappy::debug::write (const char *str, bool newline=false) noexcept
 Write debug string. More...
 
void yappy::debug::writeLine (const wchar_t *str=L"") noexcept
 Write debug string and new line. More...
 
void yappy::debug::writeLine (const char *str) noexcept
 Write debug string and new line. More...
 
void yappy::debug::writef (const wchar_t *fmt,...) noexcept
 Write debug message using format string like printf. More...
 
void yappy::debug::writef (const char *fmt,...) noexcept
 Write debug message using format string like printf. More...
 
void yappy::debug::writef_nonl (const wchar_t *fmt,...) noexcept
 Write debug message using format string like printf. (No new line) More...
 
void yappy::debug::writef_nonl (const char *fmt,...) noexcept
 Write debug message using format string like printf. (No new line) More...
 
void yappy::trace::initialize (size_t bufsize=1024 *1024)
 Initialize trace buffer. More...
 
void yappy::trace::output ()
 Output to a temporary file and open it with notepad. More...
 
void yappy::trace::write (const char *str)
 Write string to buffer. More...
 

Detailed Description

Debug utilities.

Definition in file debug.h.

Macro Definition Documentation

#define ASSERT (   x)
Value:
ASSERT0(x, \
L"Assertion failed: " #x, \
STR2WSTR(__FUNCSIG__), __FILEW__, __LINE__)
#define STR2WSTR(s)
Definition: debug.h:11
#define ASSERT0(x, msg, sig, file, line)
Definition: debug.h:22

Assertion which uses debug framework.

If x is false, prints information(func, file, line) and calls DebugBreak() API.

Parameters
[in]xA value which must be true.

Definition at line 18 of file debug.h.

#define ASSERT0 (   x,
  msg,
  sig,
  file,
  line 
)
Value:
do { \
if (!(x)) { \
yappy::debug::writef(L"%s (%s: %d)", sig, file, line); \
::DebugBreak(); \
} \
} while (0)
void writeLine(const char *str) noexcept
Write debug string and new line.
Definition: debug.h:71
void writef(const wchar_t *fmt,...) noexcept
Write debug message using format string like printf.
Definition: debug.cpp:103
char msg[LINE_DATA_SIZE-sizeof(LARGE_INTEGER)-sizeof(uint32_t)]
Definition: debug.cpp:159

Definition at line 22 of file debug.h.

#define STR2WSTR (   s)    STR2WSTR0(s)

Definition at line 11 of file debug.h.

#define STR2WSTR0 (   s)    L ## s

Definition at line 10 of file debug.h.