MLIB
Loading...
Searching...
No Matches
dprintf.cpp File Reference

Implementation of dprintf() function. More...

#include <mlib/mlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <thread>
#include <mutex>
#include <sstream>
#include <cstring>
#include <mlib/critsect.h>

Functions

bool dprintf (const char *fmt,...)
 A printf-style function, writes debug messages.
 

Detailed Description

Implementation of dprintf() function.

Function Documentation

◆ dprintf()

bool dprintf ( const char * fmt,
... )

A printf-style function, writes debug messages.

On Windows platform, the function uses the OutputDebugString API call to generate the output. On other platforms, output is sent to stderr.

Message length is limited to MAX_DPRINTF_CHARS characters.

Parameters
fmtprint format
Returns
true if successful, false otherwise
Note
Function is thread-safe. Calls from different threads are serialized by a critical section object.