docs(src): add examples alias and general cleanup (#2763)

This commit is contained in:
ReenigneArcher
2024-06-28 08:34:14 -04:00
committed by GitHub
parent 49b6efcdfd
commit 1dd4b68e1c
142 changed files with 4218 additions and 1177 deletions

View File

@@ -1,9 +1,7 @@
/**
* @file src/logging.h
* @brief Logging header file for the Sunshine application.
* @brief Declarations for logging related functions.
*/
// macros
#pragma once
// lib includes
@@ -19,20 +17,62 @@ extern boost::log::sources::severity_logger<int> warning;
extern boost::log::sources::severity_logger<int> error;
extern boost::log::sources::severity_logger<int> fatal;
/**
* @brief Handles the initialization and deinitialization of the logging system.
*/
namespace logging {
class deinit_t {
public:
/**
* @brief A destructor that restores the initial state.
*/
~deinit_t();
};
/**
* @brief Deinitialize the logging system.
* @examples
* deinit();
* @examples_end
*/
void
deinit();
/**
* @brief Initialize the logging system.
* @param min_log_level The minimum log level to output.
* @param log_file The log file to write to.
* @return An object that will deinitialize the logging system when it goes out of scope.
* @examples
* log_init(2, "sunshine.log");
* @examples_end
*/
[[nodiscard]] std::unique_ptr<deinit_t>
init(int min_log_level, const std::string &log_file);
/**
* @brief Setup AV logging.
* @param min_log_level The log level.
*/
void
setup_av_logging(int min_log_level);
/**
* @brief Flush the log.
* @examples
* log_flush();
* @examples_end
*/
void
log_flush();
/**
* @brief Print help to stdout.
* @param name The name of the program.
* @examples
* print_help("sunshine");
* @examples_end
*/
void
print_help(const char *name);
} // namespace logging