|
| const char * | LogSeverityName (LogSeverity severity) |
| constexpr LogCategory | MakeLogCategory (std::string_view staticName) |
| | A category named staticName, which must be a static string.
|
| template<typename T> |
| LogArg | MakeLogArg (const T &value) |
| std::string_view | LogArgText (const LogRecord &record, const LogArg &arg) |
| size_t | FormatLogMessage (const LogRecord &record, std::span< char > out) |
| | Writes the template with its arguments substituted, NUL-terminated and truncated to out.
|
| void | SetLogConsoleOutput (bool enabled) |
| | Turns the built-in stdout/stderr/debugger sink on or off (on by default). [AnyThread].
|
| bool | AddLogSink (LogSinkFn sink, void *context) |
| | Registers sink, called with every record and context.
|
| void | RemoveLogSink (LogSinkFn sink, void *context) |
| | Unregisters a sink added with the same sink and context. [MainThread].
|
| void | LogMessage (LogCategory category, LogSeverity severity, std::string_view messageTemplate, std::span< const LogArg > args, const char *file="", uint32_t line=0) |
| | Emits one record. Prefer the TACHYON_LOG_* macros, which add the source location. [AnyThread].
|
| void | ReportMisuse (LogCategory category, const char *message) |
| | API misuse (an unbalanced Begin/End, a call outside its frame, ...) is reported, not fatal: the caller recovers and the app carries on.
|
| void | ResetMisuseReports () |
| | Lets every misuse be reported again (tests). [AnyThread].
|
| uint64_t | LatestLogSequence () |
| | Sequence number of the newest record (0 before the first). [AnyThread].
|
| uint32_t | CopyRecentLogRecords (std::span< LogRecord > out) |
| | Copies up to out.size() of the most recent records, oldest first.
|
| template<typename... Args> |
| void | Log (LogCategory category, LogSeverity severity, const char *file, uint32_t line, std::string_view messageTemplate, const Args &... args) |
| | Emits a record with args (at most kMaxLogArgs) for the {} in messageTemplate; what the TACHYON_LOG_* macros call.
|
| ProfilerCollector & | MainThreadCollector () |
| bool | IsProfilingEnabled () |
| void | SetProfilingEnabled (bool enabled) |
| void | Reset (ProfilerCollector &collector) |
| | Discards all nodes and history; cached scope sites re-resolve.
|
| void | EnterScope (ProfilerCollector &collector, uint64_t nameHash, const char *name, bool isWait=false, const char *file="", int line=0) noexcept |
| | Uncached scope entry, for direct use and tests; pair with ExitScope.
|
| std::span< const ProfileSample > | LastFrameSamples (const ProfilerCollector &collector) |
| | The nodes of the last finalized frame, depth-first. Valid until the next EndFrame.
|
| double | LastFrameTotalMs (const ProfilerCollector &collector) |
| | Smoothed total of the root scope(s): the frame total, in milliseconds.
|
|
| constexpr int | kMaxLogArgs = 4 |
| constexpr int | kLogTextCapacity = 384 |
| | bytes shared by a record's text arguments
|
| constexpr int | kLogRingCapacity = 1024 |
| constexpr int | kMaxLogSinks = 8 |
| void | SetMinimumLogSeverity (LogSeverity severity) |
| | Records below the minimum severity are dropped before any work is done.
|
| LogSeverity | GetMinimumLogSeverity () |
| | Records below the minimum severity are dropped before any work is done.
|
| void | BeginFrame (ProfilerCollector &collector) |
| | Frame boundaries: call once each, around all scopes for the frame.
|
| void | EndFrame (ProfilerCollector &collector) |
| | Frame boundaries: call once each, around all scopes for the frame.
|
| void | EnterScope (ProfilerCollector &collector, ScopeLocation &loc) noexcept |
| | Cached scope entry / exit, as the macros use.
|
| void | ExitScope (ProfilerCollector &collector) noexcept |
| | Cached scope entry / exit, as the macros use.
|