Phosphor
phosphor::TraceLogConfig Class Reference

#include <trace_config.h>

Public Member Functions

 TraceLogConfig ()
 
TraceLogConfigsetStartupTrace (const TraceConfig &_startup_trace)
 
TraceLogConfigclearStartupTrace ()
 
TraceConfiggetStartupTrace () const
 
TraceLogConfigfromEnvironment ()
 

Protected Attributes

std::unique_ptr< TraceConfigstartup_trace
 

Detailed Description

The TraceLogConfig is used to perform a one-time config of a TraceLog for anything that must be set only once e.g. the config to automatically use on startup.

The TraceLogConfig can either be passed in when the TraceLog is created, or by using the TraceLog::configure() method prior to the first time the TraceLog is started.

Constructor & Destructor Documentation

phosphor::TraceLogConfig::TraceLogConfig ( )
inline

Default constructor

Member Function Documentation

TraceLogConfig & phosphor::TraceLogConfig::clearStartupTrace ( )

Clears the startup trace config that has previously been stored so that tracing on startup can be disabled.

Returns
A reference to this config
TraceLogConfig & phosphor::TraceLogConfig::fromEnvironment ( )

Factory method which sets up a TraceLogConfig from the environment variables

Note: This is a member function because MSVC2012 can't do copy elision properly.

Parameters
theTraceLogConfig to initialise
TraceConfig * phosphor::TraceLogConfig::getStartupTrace ( ) const
Returns
a pointer to the TraceConfig (Because it is potentially null, i.e. tracing should not start)
TraceLogConfig & phosphor::TraceLogConfig::setStartupTrace ( const TraceConfig _startup_trace)

Sets the TraceLog to start tracing immediately on construction with a particular config

Parameters
_startup_traceA reference to a preexisting config that will be copied for internal storage.
Returns
A reference to this config

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