Contur 2
Educational OS kernel simulator
Loading...
Searching...
No Matches
i_tracer.h
Go to the documentation of this file.
1
3
4#pragma once
5
6#include <cstdint>
7#include <string_view>
8
10
11namespace contur {
12
13 class IClock;
14
16 class ITracer
17 {
18 public:
20 virtual ~ITracer() = default;
21
24 virtual void trace(const TraceEvent &event) = 0;
25
29 virtual void pushScope(std::string_view subsystem, std::string_view operation) = 0;
30
32 virtual void popScope() = 0;
33
36 [[nodiscard]] virtual std::uint32_t currentDepth() const noexcept = 0;
37
40 virtual void setMinLevel(TraceLevel level) noexcept = 0;
41
43 [[nodiscard]] virtual TraceLevel minLevel() const noexcept = 0;
44
47 [[nodiscard]] virtual const IClock &clock() const noexcept = 0;
48 };
49
50} // namespace contur
Abstract clock interface for simulation time.
Definition clock.h:21
Tracer interface used by kernel subsystems.
Definition i_tracer.h:17
virtual void setMinLevel(TraceLevel level) noexcept=0
Sets minimum event level that will be emitted.
virtual ~ITracer()=default
Virtual destructor for polymorphic cleanup.
virtual std::uint32_t currentDepth() const noexcept=0
Returns current tracing depth for this tracer.
virtual const IClock & clock() const noexcept=0
Returns tracer clock reference.
virtual void pushScope(std::string_view subsystem, std::string_view operation)=0
Enters a nested tracing scope.
virtual void trace(const TraceEvent &event)=0
Emits a pre-constructed trace event.
virtual TraceLevel minLevel() const noexcept=0
Returns minimum event level that will be emitted.
virtual void popScope()=0
Leaves the current tracing scope.
Definition block.h:15
TraceLevel
Trace event severity.
Definition trace_level.h:13
Structured trace event record.
Definition trace_event.h:21
Structured trace event record shared by tracing components.