nngn
Loading...
Searching...
No Matches
nngn::Log Class Reference

#include <log.h>

Classes

struct  context
 
class  replace
 

Public Member Functions

template<typename F >
 with_context (const char *name, F f)
 

Static Public Member Functions

static std::ostream * set (std::ostream *l)
 
static std::ostream & l ()
 
static void perror (const char *s=nullptr)
 
template<typename F >
static std::string capture (F f)
 
template<typename F >
static with_context (const char *name, F f)
 

Static Public Attributes

static constexpr uint8_t MAX_DEPTH = 16
 

Private Types

using record = std::tuple<const char*, const char*>
 

Static Private Attributes

static std::ostream * stream
 
static thread_local uint8_t depth = 0
 
static thread_local std::array< record, MAX_DEPTHstack
 

Friends

std::ostream & operator<< (std::ostream &os, Log::record r)
 

Member Typedef Documentation

◆ record

using nngn::Log::record = std::tuple<const char*, const char*>
private

Member Function Documentation

◆ capture()

template<typename F >
std::string nngn::Log::capture ( F f)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ l()

std::ostream & nngn::Log::l ( )
static
Here is the caller graph for this function:

◆ perror()

void nngn::Log::perror ( const char * s = nullptr)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set()

std::ostream * nngn::Log::set ( std::ostream * l)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ with_context() [1/2]

template<typename F >
static nngn::Log::with_context ( const char * name,
F f )
static
Here is the caller graph for this function:

◆ with_context() [2/2]

template<typename F >
nngn::Log::with_context ( const char * name,
F f )
Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
Log::record r )
friend

Member Data Documentation

◆ depth

thread_local uint8_t nngn::Log::depth = 0
staticprivate

◆ MAX_DEPTH

uint8_t nngn::Log::MAX_DEPTH = 16
staticconstexpr

◆ stack

thread_local std::array< Log::record, Log::MAX_DEPTH > nngn::Log::stack
staticprivate

◆ stream

std::ostream * nngn::Log::stream
staticprivate
Initial value:
=
[]{ const auto init = std::ios_base::Init(); return &std::cerr; }()
init
Definition img_common.lua:34

The documentation for this class was generated from the following files: