mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 19:13:34 +00:00
refactor(logs): update log formatting for systemd services and handle merging in the client
This commit is contained in:
+5
-3
@@ -57,14 +57,15 @@ type ServiceLogsOptions struct {
|
||||
Machines []string
|
||||
}
|
||||
|
||||
// ServiceLogEntry represents a single log entry from a service container.
|
||||
// ServiceLogEntry represents a single log entry from a service container or systemd service.
|
||||
type ServiceLogEntry struct {
|
||||
// Metadata may not be set if an error occurred (Err is not nil).
|
||||
Metadata ServiceLogEntryMetadata
|
||||
LogEntry
|
||||
}
|
||||
|
||||
// ServiceLogEntryMetadata contains metadata about the source of a log entry.
|
||||
// ServiceLogEntryMetadata identifies the source of a log entry.
|
||||
// For systemd service logs, ServiceID and ServiceName hold the unit name and ContainerID is empty.
|
||||
type ServiceLogEntryMetadata struct {
|
||||
ServiceID string
|
||||
ServiceName string
|
||||
@@ -77,7 +78,8 @@ type ServiceLogEntryMetadata struct {
|
||||
type LogEntry struct {
|
||||
Stream LogStreamType
|
||||
Timestamp time.Time
|
||||
Message []byte
|
||||
// Message is the raw log line as bytes terminated with a trailing newline.
|
||||
Message []byte
|
||||
// Err indicates that an error occurred while streaming logs from a container.
|
||||
// Other fields are not set if Err is not nil.
|
||||
Err error
|
||||
|
||||
Reference in New Issue
Block a user