Phosphor
phosphor::tools::FileStopCallback Class Reference

#include <export.h>

Inheritance diagram for phosphor::tools::FileStopCallback:
phosphor::TracingStoppedCallback

Public Member Functions

 FileStopCallback (const std::string &_file_path="phosphor.%p.json")
 
void operator() (TraceLog &log, std::lock_guard< TraceLog > &lh) override
 

Protected Member Functions

StringPtr generateFilePathAsPtr ()
 

Detailed Description

Reference callback for saving a buffer to a file if tracing stops.

This saves the buffer to file in the same thread that it is called from so that it may be used after main has returned (e.g. to write everything that a given process has traced when the global TraceLog is destructed).

Constructor & Destructor Documentation

phosphor::tools::FileStopCallback::FileStopCallback ( const std::string &  _file_path = "phosphor.%p.json")
Parameters
_file_pathFile path to save the buffer to on completion, may accept the wild cards p for PID and d for an ISOish timestamp 'YYYY.MM.DDTHH.MM.SS'

Member Function Documentation

void phosphor::tools::FileStopCallback::operator() ( TraceLog log,
std::lock_guard< TraceLog > &  lh 
)
overridevirtual

Callback method called by TraceLog

Parameters
logReference to the calling TraceLog
lhThe lock being held when this callback is invoked

Implements phosphor::TracingStoppedCallback.


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