Sunshine0.0.5917
Sunshine 0.0.5917
Self-hosted game stream host for Moonlight.
Loading...
Searching...
No Matches
logging.h File Reference

Declarations for logging related functions. More...

#include <cstddef>
#include <filesystem>
#include <format>
#include <string>
#include <system_error>
#include <boost/log/common.hpp>
#include <boost/log/sinks.hpp>
#include "config.h"
#include "stat_trackers.h"
Include dependency graph for logging.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  logging::deinit_t
 RAII helper that runs shutdown cleanup when destroyed. More...
class  logging::min_max_avg_periodic_logger< T >
 A helper class for tracking and logging numerical values across a period of time. More...
class  logging::time_delta_periodic_logger
 A helper class for tracking and logging short time intervals across a period of time. More...

Namespaces

namespace  logging
 Handles the initialization and deinitialization of the logging system.

Typedefs

using text_sink = boost::log::sinks::asynchronous_sink<boost::log::sinks::text_ostream_backend>
 Boost.Log asynchronous text sink used by Sunshine logging.

Functions

std::string logging::bracket (const std::string &input)
 Enclose string in square brackets.
std::wstring logging::bracket (const std::wstring &input)
 Enclose string in square brackets.
void logging::deinit ()
 Deinitialize the logging system.
void logging::formatter (const boost::log::record_view &view, boost::log::formatting_ostream &os)
 Format a Boost.Log record for Sunshine log output.
std::unique_ptr< deinit_t > logging::init (int min_log_level, const std::string &log_file)
 Rotate the current log file and initialize the logging system.
void logging::log_flush ()
 Flush the log.
void logging::print_help (const char *name)
 Print help to stdout.
std::error_code logging::rotate_log_file (const std::filesystem::path &log_file) noexcept
 Rotate a log file while retaining up to five previous logs.
void logging::setup_av_logging (int min_log_level)
 Setup AV logging.
void logging::setup_libdisplaydevice_logging (int min_log_level)
 Set up libdisplaydevice logging, clamping to its supported enum values.

Variables

boost::log::sources::severity_logger< int > debug
 Debug.
boost::log::sources::severity_logger< int > error
 Error.
boost::log::sources::severity_logger< int > fatal
 Fatal.
boost::log::sources::severity_logger< int > info
 Info.
constexpr std::size_t logging::retained_log_file_count {5}
 The number of previous log files retained during rotation.
boost::log::sources::severity_logger< int > verbose
 Verbose.
boost::log::sources::severity_logger< int > warning
 Warning.

Detailed Description

Declarations for logging related functions.

Variable Documentation

◆ debug

boost::log::sources::severity_logger<int> debug
extern

Debug.

Follow what is happening.

Debug.

◆ error

boost::log::sources::severity_logger<int> error
extern

Error.

Recoverable errors.

Error.

◆ fatal

boost::log::sources::severity_logger<int> fatal
extern

Fatal.

Unrecoverable errors.

Fatal.

◆ info

boost::log::sources::severity_logger<int> info
extern

Info.

Should be informed about.

Info.

◆ verbose

boost::log::sources::severity_logger<int> verbose
extern

Verbose.

Dominating output.

Verbose.

◆ warning

boost::log::sources::severity_logger<int> warning
extern

Warning.

Strange events.

Warning.