LogIt++
Header-only, macro-first C++ logging library
Loading...
Searching...
No Matches
system_error_macros.hpp File Reference

Internal helpers shared by the system error logging macros. More...

#include <errno.h>
#include <cstring>
#include <string>

Go to the source code of this file.

Namespaces

namespace  logit
 The primary namespace for the LogIt++ library.
 
namespace  logit::detail
 

Macros

#define LOGIT_CPP_HEADER_LOGIT_CPP_LOGIT_DETAIL_SYSTEM_ERROR_MACROS_HPP_INCLUDED
 
#define LOGIT_DETAIL_PERROR(level_macro, message)
 
#define LOGIT_DETAIL_WINERR(level_macro, message)
 

Detailed Description

Internal helpers shared by the system error logging macros.

Definition in file system_error_macros.hpp.

Macro Definition Documentation

◆ LOGIT_CPP_HEADER_LOGIT_CPP_LOGIT_DETAIL_SYSTEM_ERROR_MACROS_HPP_INCLUDED

#define LOGIT_CPP_HEADER_LOGIT_CPP_LOGIT_DETAIL_SYSTEM_ERROR_MACROS_HPP_INCLUDED

Definition at line 3 of file system_error_macros.hpp.

◆ LOGIT_DETAIL_PERROR

#define LOGIT_DETAIL_PERROR ( level_macro,
message )
Value:
do { \
const int _logit_errno_code = (errno); \
const char *_logit_errno_desc = ::strerror(_logit_errno_code); \
if (_logit_errno_desc == nullptr) { \
_logit_errno_desc = ""; \
} \
const std::string _logit_errno_text(message); \
LOGIT_PRINTF_##level_macro(LOGIT_POSIX_ERROR_PATTERN, \
_logit_errno_text.c_str(), \
_logit_errno_code, \
_logit_errno_desc); \
} while (0)
#define LOGIT_POSIX_ERROR_PATTERN
Format string used when appending POSIX errno information to a log message.
Definition config.hpp:172

Definition at line 49 of file system_error_macros.hpp.

◆ LOGIT_DETAIL_WINERR

#define LOGIT_DETAIL_WINERR ( level_macro,
message )
Value:
do { } while (0)

Definition at line 78 of file system_error_macros.hpp.