Symbian platform (C++)
SDK native APIs, runtime and tooling
Loading...
Searching...
No Matches
guest_log.h
Go to the documentation of this file.
1// Copyright 2026 The Symbian SDK Authors.
2// Licensed under the Apache License, Version 2.0.
3
4#ifndef SYMBIAN_AGENT_GUEST_LOG_H_
5#define SYMBIAN_AGENT_GUEST_LOG_H_
6
7#include <array>
8#include <cstddef>
9#include <cstdint>
10
11#include "absl/status/statusor.h"
12#include "absl/time/clock.h"
13#include "absl/time/time.h"
14
15namespace symbian::agent {
16
18enum class AgentLogCode : std::uint8_t {
20 kStatusRead = 2,
23};
24
26enum class AgentLogSeverity : std::uint8_t {
27 kDebug = 1,
28 kInfo = 2,
29 kWarning = 3,
30};
31
40
43 std::array<AgentLogRecord, 8> records{};
44 std::uint8_t count = 0;
45 std::uint64_t next_cursor = 0;
46 bool gap = false;
47};
48
57 public:
58 static constexpr std::size_t kCapacity = 32;
59
62
69 absl::StatusOr<AgentLogPage> ReadAfter(std::uint64_t cursor,
70 std::uint8_t limit) const;
71
72 private:
73 std::array<AgentLogRecord, kCapacity> records_{};
74 absl::Time started_ = absl::Now();
75 std::uint64_t last_elapsed_microseconds_ = 0;
76 std::uint64_t next_sequence_ = 1;
77};
78
79} // namespace symbian::agent
80
81#endif // SYMBIAN_AGENT_GUEST_LOG_H_
Fixed 32-record service log with a monotonic sequence cursor.
Definition guest_log.h:56
absl::StatusOr< AgentLogPage > ReadAfter(std::uint64_t cursor, std::uint8_t limit) const
Return up to 1–8 records after a cursor.
Definition guest_log.cc:41
static constexpr std::size_t kCapacity
Definition guest_log.h:58
void Append(AgentLogCode code)
Append one event, overwriting the oldest at capacity.
Definition guest_log.cc:30
std::vector< uint32_t > code
Definition e32.cc:70
Definition control.cc:11
AgentLogSeverity
Severity of one service-local event; future values may be added.
Definition guest_log.h:26
AgentLogCode
Small, stable agent event codes; unknown future values are allowed.
Definition guest_log.h:18
One bounded read result, including a lost-record signal.
Definition guest_log.h:42
std::uint64_t next_cursor
Definition guest_log.h:45
std::uint8_t count
Definition guest_log.h:44
bool gap
Definition guest_log.h:46
std::array< AgentLogRecord, 8 > records
Definition guest_log.h:43
One retained event in the agent's own process.
Definition guest_log.h:33
std::uint64_t elapsed_microseconds
Clamped microseconds since this ring was constructed; not UTC or persistent.
Definition guest_log.h:38
AgentLogCode code
Definition guest_log.h:35
AgentLogSeverity severity
Definition guest_log.h:36
std::uint64_t sequence
Definition guest_log.h:34