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 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 * >
 
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)
 
std::ostream & operator<< (std::ostream &os, Log::record r)
 

Member Typedef Documentation

◆ record [1/2]

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

◆ record [2/2]

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

Member Function Documentation

◆ capture() [1/2]

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:

◆ capture() [2/2]

template<typename F >
static std::string nngn::Log::capture ( F  f)
static

◆ l() [1/2]

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

◆ l() [2/2]

static std::ostream & nngn::Log::l ( )
static

◆ perror() [1/2]

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:

◆ perror() [2/2]

static void nngn::Log::perror ( const char *  s = nullptr)
static

◆ set() [1/2]

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:

◆ set() [2/2]

static std::ostream * nngn::Log::set ( std::ostream *  l)
static

◆ with_context() [1/3]

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/3]

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

◆ with_context() [3/3]

template<typename F >
static nngn::Log::with_context ( const char *  name,
F  f 
)
static

Friends And Related Function Documentation

◆ operator<< [1/2]

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

◆ operator<< [2/2]

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

Member Data Documentation

◆ depth

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

◆ MAX_DEPTH

static constexpr uint8_t nngn::Log::MAX_DEPTH = 16
staticconstexpr

◆ stack

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

◆ stream

static 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: