SoundFontInfoLib  2.21.6
Library for parsing and rendering SF2 files
SF2::Logger Struct Reference

Light wrapper around a os_log_t value that provides for building log message content via '<<' operators. More...

#include <Logger.hpp>

Public Member Functions

 operator os_log_t () const
 Allow Logger instances to appear in os_log API calls. More...
 
std::ostream & debug ()
 
std::ostream & info ()
 
std::ostream & error ()
 
std::ostream & fault ()
 

Static Public Member Functions

static Logger Make (const std::string &subsystem, const std::string &category)
 Create a new os_log_t instance. More...
 

Static Public Attributes

static const std::string base {"com.braysoft.SoundFontInfoLib.SF2."}
 Base name to use for all os_log subsystem names. More...
 

Detailed Description

Light wrapper around a os_log_t value that provides for building log message content via '<<' operators.

Example: log_.debug() << "the value " << foo << " is invalid" << std::endl;

The buffer continues to accumulate data until the std::endl manipulator at which point the buffer sends its contents to os_log and resets. Note that the end result is always emitted via a "%{public}s" format so care should be taken to not leak any personal info.

Member Function Documentation

◆ debug()

std::ostream& SF2::Logger::debug ( )
inline

◆ error()

std::ostream& SF2::Logger::error ( )
inline
Returns
stream to use for error-level messages (NOTE: streams are not thread-safe)

◆ fault()

std::ostream& SF2::Logger::fault ( )
inline
Returns
stream to use for fault-level messages (NOTE: streams are not thread-safe)

◆ info()

std::ostream& SF2::Logger::info ( )
inline
Returns
stream to use for info-level messages (NOTE: streams are not thread-safe)

◆ Make()

static Logger SF2::Logger::Make ( const std::string &  subsystem,
const std::string &  category 
)
inlinestatic

Create a new os_log_t instance.

Parameters
subsystemthe subsystem name to use. This will be appended to base.
categorythe category to use
Returns
new/existing os_log_ instance

References base.

◆ operator os_log_t()

SF2::Logger::operator os_log_t ( ) const
inline

Allow Logger instances to appear in os_log API calls.

Returns
internal os_log_t value

Member Data Documentation

◆ base

const std::string SF2::Logger::base {"com.braysoft.SoundFontInfoLib.SF2."}
inlinestatic

Base name to use for all os_log subsystem names.

Referenced by Make().


The documentation for this struct was generated from the following file: