Fabcoin Core  0.16.2
P2P Digital Currency
Classes | Namespaces | Macros | Enumerations | Functions | Variables
Log.h File Reference
#include <ctime>
#include <chrono>
#include "vector_ref.h"
#include "Common.h"
#include "CommonIO.h"
#include "CommonData.h"
#include "FixedHash.h"
#include "Terminal.h"
Include dependency graph for Log.h:

Go to the source code of this file.

Classes

class  dev::NullOutputStream
 The null output stream. Used when logging is disabled. More...
 
class  dev::LogOverrideAux
 
class  dev::LogOverride< Channel >
 
struct  dev::VerbosityHolder
 Temporary changes system's verbosity for specific function. More...
 
class  dev::ThreadContext
 
struct  dev::LogChannel
 The default logging channels. More...
 
struct  dev::LeftChannel
 
struct  dev::RightChannel
 
struct  dev::WarnChannel
 
struct  dev::NoteChannel
 
struct  dev::DebugChannel
 
struct  dev::TraceChannel
 
class  dev::LogOutputStreamBase
 
class  dev::LogOutputStream< Id, _AutoSpacing >
 Logging class, iostream-like, that can be shifted to. More...
 

Namespaces

 dev
 Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Originally by RenĂ© Nyffenegger.
 

Macros

#define ETH_THREAD_CONTEXT(name)   for (std::pair<dev::ThreadContext, bool> __eth_thread_context(name, true); p.second; p.second = false)
 
#define DEV_STATEMENT_IF(COND)   for (bool i_eth_if_ = (COND); i_eth_if_; i_eth_if_ = false)
 A "hacky" way to execute the next statement on COND. More...
 
#define DEV_STATEMENT_SKIP()   while (/*CONSTCOND*/ false) /*NOTREACHED*/
 A "hacky" way to skip the next statement. More...
 
#define clog(X)   dev::LogOutputStream<X, true>()
 
#define cslog(X)   dev::LogOutputStream<X, false>()
 
#define cdebug   clog(dev::DebugChannel)
 
#define cnote   clog(dev::NoteChannel)
 
#define cwarn   clog(dev::WarnChannel)
 
#define ctrace   clog(dev::TraceChannel)
 
#define ndebug   DEV_STATEMENT_SKIP() dev::NullOutputStream()
 
#define nlog(X)   DEV_STATEMENT_SKIP() dev::NullOutputStream()
 
#define nslog(X)   DEV_STATEMENT_SKIP() dev::NullOutputStream()
 

Enumerations

enum  dev::LogTag { dev::LogTag::None, dev::LogTag::Url, dev::LogTag::Error, dev::LogTag::Special }
 

Functions

void dev::simpleDebugOut (std::string const &, char const *)
 A simple log-output function that prints log messages to stdout. More...
 
bool dev::isChannelVisible (std::type_info const *_ch, bool _default)
 
template<class Channel >
bool dev::isChannelVisible ()
 
void dev::setThreadName (std::string const &_n)
 Set the current thread's log name. More...
 
std::string dev::getThreadName ()
 Set the current thread's log name. More...
 

Variables

int dev::g_logVerbosity = 5
 The logging system's current verbosity. More...
 
std::function< void(std::string const &, char const *)> dev::g_logPost = simpleDebugOut
 The current method that the logging system uses to output the log messages. Defaults to simpleDebugOut(). More...
 

Detailed Description

Author
Gav Wood i@gav.nosp@m.wood.nosp@m..com
Date
2014

The logging subsystem.

Definition in file Log.h.

Macro Definition Documentation

#define cdebug   clog(dev::DebugChannel)

Definition at line 302 of file Log.h.

#define clog (   X)    dev::LogOutputStream<X, true>()

Definition at line 295 of file Log.h.

#define cnote   clog(dev::NoteChannel)

Definition at line 303 of file Log.h.

#define cslog (   X)    dev::LogOutputStream<X, false>()

Definition at line 296 of file Log.h.

#define ctrace   clog(dev::TraceChannel)

Definition at line 305 of file Log.h.

#define cwarn   clog(dev::WarnChannel)

Definition at line 304 of file Log.h.

#define DEV_STATEMENT_IF (   COND)    for (bool i_eth_if_ = (COND); i_eth_if_; i_eth_if_ = false)

A "hacky" way to execute the next statement on COND.

We need such a thing due to the dangling else problem and the need for the logging macros to end with the stream object and not a closing brace '}'

Definition at line 281 of file Log.h.

#define DEV_STATEMENT_SKIP ( )    while (/*CONSTCOND*/ false) /*NOTREACHED*/

A "hacky" way to skip the next statement.

We need such a thing due to the dangling else problem and the need for the logging macros to end with the stream object and not a closing brace '}'

Definition at line 285 of file Log.h.

#define ETH_THREAD_CONTEXT (   name)    for (std::pair<dev::ThreadContext, bool> __eth_thread_context(name, true); p.second; p.second = false)

Definition at line 87 of file Log.h.

#define ndebug   DEV_STATEMENT_SKIP() dev::NullOutputStream()

Definition at line 308 of file Log.h.

#define nlog (   X)    DEV_STATEMENT_SKIP() dev::NullOutputStream()

Definition at line 309 of file Log.h.

#define nslog (   X)    DEV_STATEMENT_SKIP() dev::NullOutputStream()

Definition at line 310 of file Log.h.