Typedefs | |
| using | Address = std::string |
| using | RequestId = std::string |
| using | Value |
| using | ConnectionStateHandler = std::function<void(const ConnectionStateChange&)> |
| using | SubscriptionHandler = std::function<void(const Notification&)> |
| using | Variant |
| using | DataCallback |
| using | PairVariant = std::pair<std::string, Variant> |
| using | ListVariant = std::list<PairVariant> |
| using | VectorVariant = std::vector<PairVariant> |
Enumerations | |
| enum class | Status { Ok , Timeout , NotConnected , AlreadyConnected , InvalidState , BadRequest , NotFound , AccessDenied , TypeMismatch , Unsupported , Cancelled , RemoteError , TransportError , InternalError } |
| enum class | ConnectionState { Disconnected , Connecting , Connected , Disconnecting , Faulted } |
| enum class | LogLevel : int { TRACE = 0 , DEBUG = 10 , INFO = 20 , WARNING = 30 , ERROR = 40 , OFF = 100 } |
| Log severity, lowest to highest. More... | |
Functions | |
| bool | FileExists (const std::string &path) |
| Wrapper around std::filesystem::exists(). | |
| std::string | FindFile (const std::string &filename) |
| Search the CFGPATH environment variable for the given file. | |
| std::string | Trim (const std::string &s, const std::string &chars=" \t") |
| Strip leading and trailing occurrences of any character in chars from s. | |
| std::string | ThreadName () |
| Return the current thread name (pthread_getname_np), or "" if unavailable. Bounded at 16 chars by the Linux pthread API. | |
| std::string | IsoTimeNow (int frac_digits=6) |
| Return the current UTC time as an ISO 8601 string with frac_digits fractional second digits (default 6: microseconds). Matches ifw::fnd::IsoTimeNow() semantics closely enough for log formatting purposes. | |
| void | InstallLogger (std::unique_ptr< Logger > logger) noexcept |
| Install the process-wide logger. | |
| Logger & | Log () |
| Access the installed logger. | |
| bool | HasLogger () noexcept |
true iff a logger has been installed. | |
| std::unique_ptr< Logger > | MakeStdoutLogger () |
| Factory: a logger that prints to stdout. | |
| std::unique_ptr< Logger > | MakeNullLogger () |
| Factory: a logger that discards everything. | |
| std::string_view | LogLevelName (LogLevel level) noexcept |
Render a LogLevel as a short uppercase string. | |
| std::string | TraceExtra () |
Helper used by UATTRACE. | |
| template<typename... Args> | |
| std::string | TraceExtra (fmt::string_view fmt_str, Args &&... args) |
Variables | |
| constexpr std::uint32_t | kContractVersion = 2 |
| using eso::uatools::protocol::base::Address = std::string |
| using eso::uatools::protocol::base::ConnectionStateHandler = std::function<void(const ConnectionStateChange&)> |
| using eso::uatools::protocol::base::ListVariant = std::list<PairVariant> |
| using eso::uatools::protocol::base::PairVariant = std::pair<std::string, Variant> |
| using eso::uatools::protocol::base::RequestId = std::string |
| using eso::uatools::protocol::base::SubscriptionHandler = std::function<void(const Notification&)> |
| using eso::uatools::protocol::base::VectorVariant = std::vector<PairVariant> |
|
strong |
|
strong |
|
strong |
| bool eso::uatools::protocol::base::FileExists | ( | const std::string & | path | ) |
Wrapper around std::filesystem::exists().
| std::string eso::uatools::protocol::base::FindFile | ( | const std::string & | filename | ) |
Search the CFGPATH environment variable for the given file.
| filename | Relative or absolute path of the file to locate. |
Resolution order:
|
noexcept |
true iff a logger has been installed.
Provided so that low-level code (signal handlers, destructors running during shutdown) can avoid raising on a missing logger.
|
noexcept |
Install the process-wide logger.
Must be called once, early in main(), before any uatools API call that may log. Ownership is transferred to uatools. Calling twice replaces the previous logger and destroys it.
|
inline |
Return the current UTC time as an ISO 8601 string with frac_digits fractional second digits (default 6: microseconds). Matches ifw::fnd::IsoTimeNow() semantics closely enough for log formatting purposes.
| Logger & eso::uatools::protocol::base::Log | ( | ) |
Access the installed logger.
| std::runtime_error | if no logger has been installed. |
|
noexcept |
Render a LogLevel as a short uppercase string.
Returns "TRACE" / "DEBUG" / "INFO" / "WARNING" / "ERROR" / "OFF". Used by MakeStdoutLogger() and available for downstream implementations.
| std::unique_ptr< Logger > eso::uatools::protocol::base::MakeNullLogger | ( | ) |
Factory: a logger that discards everything.
Useful for unit tests that want uatools to be silent without having to redirect stdout.
| std::unique_ptr< Logger > eso::uatools::protocol::base::MakeStdoutLogger | ( | ) |
Factory: a logger that prints to stdout.
Format: "<level> <message>\n". Intended for standalone tools and unit tests, not for production deployments.
|
inline |
Return the current thread name (pthread_getname_np), or "" if unavailable. Bounded at 16 chars by the Linux pthread API.
|
inline |
Helper used by UATTRACE.
UATTRACE() with no extra args returns "". With a format string (and optional args) returns the formatted result. Variadic templates handle the "first arg is format string" split that the C++ preprocessor can't do cleanly.
|
inline |
| std::string eso::uatools::protocol::base::Trim | ( | const std::string & | s, |
| const std::string & | chars = " \t" ) |
Strip leading and trailing occurrences of any character in chars from s.
Defaults to ASCII whitespace (space + tab) to match the previous ifw::core::utils::string::Trim(s, " \t") behaviour.
|
inlineconstexpr |