CppTrail
Loading...
Searching...
No Matches
def.h File Reference

Global definitions, enumerations, and string mapping utilities for CppTrail. More...

#include <string_view>
#include <array>
#include <string>
#include "cpptrail/utf42.h"
Include dependency graph for def.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CppTrail::Detail::LevelName< char_t >
 Template utility to map Level enums to string representations. More...
 

Namespaces

namespace  CppTrail
 Root namespace for the CppTrail logging library.
 
namespace  Detail
 Internal implementation details. Not intended for direct public use.
 

Enumerations

enum class  CppTrail::Status { CppTrail::RUNNING , CppTrail::STOPPED , CppTrail::BROKEN , CppTrail::TRASCENDENT }
 Represents the current operational state of a Logger implementation. More...
 
enum class  CppTrail::Level {
  CppTrail::SUCCESS , CppTrail::TRACE , CppTrail::DEBUG , CppTrail::INFO ,
  CppTrail::MESSAGE , CppTrail::WARNING , CppTrail::ERROR , CppTrail::CRITICAL ,
  CppTrail::FATAL
}
 Severity levels for log entries. More...
 

Functions

String Getters (Allocating)

Functions that return a heap-allocated copy of the level name.

std::string CppTrail::getName (const Level nLevel)
 Gets the level name as a std::string.
 
std::u8string CppTrail::u8getName (const Level nLevel)
 Gets the level name as a std::u8string.
 
std::u16string CppTrail::u16getName (const Level nLevel)
 Gets the level name as a std::u16string.
 
std::u32string CppTrail::u32getName (const Level nLevel)
 Gets the level name as a std::u32string.
 
template<typename char_t >
std::basic_string< char_t > CppTrail::tgetName (const Level nLevel)
 Template version for generic character types (allocating).
 
StringView Getters (Non-allocating)

High-performance functions that return views to static memory.

Note
These functions are only available when compiling with C++17 or later.
std::string_view CppTrail::getNameView (const Level nLevel)
 Gets a view of the level name.
 
std::u8string_view CppTrail::u8getNameView (const Level nLevel)
 Gets a UTF-8 view of the level name.
 
std::u16string_view CppTrail::u16getNameView (const Level nLevel)
 Gets a UTF-16 view of the level name.
 
std::u32string_view CppTrail::u32getNameView (const Level nLevel)
 Gets a UTF-32 view of the level name.
 
template<typename char_t >
std::basic_string_view< char_t > CppTrail::tgetNameView (const Level nLevel)
 Template version for generic character types (non-allocating).
 

Detailed Description

Global definitions, enumerations, and string mapping utilities for CppTrail.

Author
Dante Doménech Martínez
Note
StringView getters (getNameView, etc.) require C++17 or higher. Legacy support provided via utf42::basic_string_view for older standards.