Manages a set of destinations representing files or streams. All log messages will be written to at least one destination in this object.
More...
#include <Destination.hpp>
|
template<class DestT > |
static Destination * | getDestination (DestT &arg) |
| Requests an existing Destination* from the manager and allocates a new one if it does not yet have a destination matching the input argument.
|
|
template<std::size_t N> |
static Destination * | createDestination (const char(&arg)[N]) |
| createDestination overload for handling const char[] strings
|
|
static Destination * | createDestination (const char *&arg) |
| createDestination overload for handling char* strings
|
|
template<class DestT > |
static Destination * | createDestination (const DestT &arg) |
|
template<class DestT > |
static Destination * | createDestination (DestT &arg) |
|
static const DestinationVector & | getDestinations () |
| Returns vector containing all destinations.
|
|
static uint32_t | getNumDestinations () |
| Returns number of destinations contained in the DestinationManager.
|
|
static std::ostream & | dumpDestinations (std::ostream &o, bool pretty=false) |
| Dumps the destinations known by the destination manager to an ostream with each destination on a separate line.
|
|
static std::ostream & | dumpFileExtensions (std::ostream &o, bool pretty=false) |
| Dumps the supported file extensions for destinations instantiated through the destination manager based on strings (file paths) and describes the resulting file format used based on that extension.
|
|
Manages a set of destinations representing files or streams. All log messages will be written to at least one destination in this object.
Definition at line 535 of file Destination.hpp.
◆ DestinationVector
◆ createDestination() [1/4]
static Destination * sparta::log::DestinationManager::createDestination |
( |
const char *& |
arg | ) |
|
|
inlinestatic |
createDestination overload for handling char* strings
Definition at line 586 of file Destination.hpp.
◆ createDestination() [2/4]
template<std::size_t N>
static Destination * sparta::log::DestinationManager::createDestination |
( |
const char(&) |
arg[N] | ) |
|
|
inlinestatic |
createDestination overload for handling const char[] strings
Definition at line 581 of file Destination.hpp.
◆ createDestination() [3/4]
template<class DestT >
static Destination * sparta::log::DestinationManager::createDestination |
( |
const DestT & |
arg | ) |
|
|
inlinestatic |
◆ createDestination() [4/4]
template<class DestT >
static Destination * sparta::log::DestinationManager::createDestination |
( |
DestT & |
arg | ) |
|
|
inlinestatic |
◆ dumpDestinations()
static std::ostream & sparta::log::DestinationManager::dumpDestinations |
( |
std::ostream & |
o, |
|
|
bool |
pretty = false |
|
) |
| |
|
inlinestatic |
Dumps the destinations known by the destination manager to an ostream with each destination on a separate line.
Definition at line 619 of file Destination.hpp.
◆ dumpFileExtensions()
static std::ostream & sparta::log::DestinationManager::dumpFileExtensions |
( |
std::ostream & |
o, |
|
|
bool |
pretty = false |
|
) |
| |
|
inlinestatic |
Dumps the supported file extensions for destinations instantiated through the destination manager based on strings (file paths) and describes the resulting file format used based on that extension.
Definition at line 634 of file Destination.hpp.
◆ getDestination()
template<class DestT >
static Destination * sparta::log::DestinationManager::getDestination |
( |
DestT & |
arg | ) |
|
|
inlinestatic |
Requests an existing Destination* from the manager and allocates a new one if it does not yet have a destination matching the input argument.
- Template Parameters
-
- Parameters
-
arg | Destination identifier. This parameter is interpreted based on type and value. For example, const char*, std::string, and const char[] are interpreted to be filenames. |
- Returns
- Destination that will write incoming messages to the destination described by arg.
- Exceptions
-
Exception | if arg cannot be interpreted to describe a Destination or a file cannot be opened. |
- Note
- Not thread-safe. Destinations modifications must be protected outside of this method if thread-safety is needed \node Once a destination is constructed with an open file handle for "write", it will be appended to by this manager. \warn Filename comparisons may be performed by string comparison. Different paths referring to the same file can cause multiple destinations to be created writing to the same file.
Destinations can never be removed once constructed.
Definition at line 567 of file Destination.hpp.
◆ getDestinations()
static const DestinationVector & sparta::log::DestinationManager::getDestinations |
( |
| ) |
|
|
inlinestatic |
Returns vector containing all destinations.
Definition at line 603 of file Destination.hpp.
◆ getNumDestinations()
static uint32_t sparta::log::DestinationManager::getNumDestinations |
( |
| ) |
|
|
inlinestatic |
The documentation for this class was generated from the following file: