Code forensics  0.1
Generate historical information about code changes
logging.hpp File Reference
#include <unordered_set>
#include <fstream>
#include <chrono>
#include <boost/log/trivial.hpp>
#include <boost/log/common.hpp>
#include <boost/log/expressions.hpp>
#include <boost/log/attributes.hpp>
#include <boost/log/sinks.hpp>
#include <boost/log/sources/logger.hpp>
#include <boost/log/utility/record_ordering.hpp>
#include <boost/core/null_deleter.hpp>
#include "common.hpp"
#include "program_state.hpp"
#include <shared_mutex>
#include <indicators/progress_bar.hpp>
#include <indicators/block_progress_bar.hpp>
#include <indicators/cursor_control.hpp>
Include dependency graph for logging.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ScopedBar
 

Namespaces

 boost
 
 boost::log
 

Macros

#define CUSTOM_LOG(logger, sev)
 
#define LOG_T(state)   CUSTOM_LOG((get_logger(state)), logging::severity::trace)
 
#define LOG_D(state)   CUSTOM_LOG((get_logger(state)), logging::severity::debug)
 
#define LOG_I(state)   CUSTOM_LOG((get_logger(state)), logging::severity::info)
 
#define LOG_W(state)   CUSTOM_LOG((get_logger(state)), logging::severity::warning)
 
#define LOG_E(state)   CUSTOM_LOG((get_logger(state)), logging::severity::error)
 
#define LOG_F(state)   CUSTOM_LOG((get_logger(state)), logging::severity::fatal)
 

Typedefs

using BarText = indicators::option::PostfixText
 
using Logger = logging::sources::severity_logger< logging::trivial::severity_level >
 
using boost::log::severity = logging::trivial::severity_level
 
template<typename T >
using MutLog = logging::attrs::mutable_constant< T, std::shared_mutex >
 
using backend_t = logging::sinks::text_ostream_backend
 
using sink_t = logging::sinks::asynchronous_sink< backend_t, logging::sinks::unbounded_ordering_queue< logging::attribute_value_ordering< unsigned int, std::less< unsigned int > >> >
 

Functions

indicators::BlockProgressBar init_progress (int max, int width=60)
 
void tick_next (indicators::BlockProgressBar &bar, int &count, int max, CR< Str > name, CR< Str > extra="")
 
template<typename ValueType >
auto set_get_attrib (const char *name, ValueType value) -> ValueType
 
auto get_logger (walker_state *state) -> Logger &
 
auto get_logger (UPtr< walker_state > &state) -> Logger &
 
auto get_logger (SPtr< Logger > &in) -> Logger &
 
BOOST_LOG_ATTRIBUTE_KEYWORD(severity, "Severity", logging::trivial::severity_level) void log_formatter(logging Pair< char, fmt::text_style > format_style (logging::severity level)
 
void out_formatter (logging::record_view const &rec, logging::formatting_ostream &strm)
 
boost::shared_ptr< sink_tcreate_file_sink (CR< Str > outfile)
 
boost::shared_ptr< sink_tcreate_std_sink ()
 
void init_logger_properties ()
 

Typedef Documentation

◆ backend_t

using backend_t = logging::sinks::text_ostream_backend

◆ BarText

using BarText = indicators::option::PostfixText

◆ Logger

using Logger = logging::sources::severity_logger< logging::trivial::severity_level>

◆ sink_t

using sink_t = logging::sinks::asynchronous_sink< backend_t, logging::sinks::unbounded_ordering_queue< logging::attribute_value_ordering< unsigned int, std::less<unsigned int> >> >

Function Documentation

◆ create_file_sink()

boost::shared_ptr<sink_t> create_file_sink ( CR< Str >  outfile)

◆ create_std_sink()

boost::shared_ptr<sink_t> create_std_sink ( )

◆ format_style()

BOOST_LOG_ATTRIBUTE_KEYWORD ( severity, "Severity", logging::trivial::severity_level) void log_formatter( logging Pair<char, fmt::text_style> format_style ( logging::severity  level)

◆ init_logger_properties()

void init_logger_properties ( )

◆ init_progress()

indicators::BlockProgressBar init_progress ( int  max,
int  width = 60 
)

◆ out_formatter()

void out_formatter ( logging::record_view const &  rec,
logging::formatting_ostream &  strm 
)

◆ tick_next()

void tick_next ( indicators::BlockProgressBar &  bar,
int &  count,
int  max,
CR< Str >  name,
CR< Str >  extra = "" 
)