mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
feat(logs): include hook information in log entry formatting
This commit is contained in:
@@ -76,6 +76,8 @@ type ServiceLogEntryMetadata struct {
|
||||
ContainerID string
|
||||
MachineID string
|
||||
MachineName string
|
||||
// Hook is the hook type of the source container (e.g., "pre-deploy"). Empty for non-hook containers.
|
||||
Hook string
|
||||
}
|
||||
|
||||
// LogEntry represents a single log entry from a container or a service.
|
||||
|
||||
@@ -81,6 +81,7 @@ func (cli *Client) ServiceLogs(
|
||||
ContainerID: ctr.Container.ID,
|
||||
MachineID: ctr.MachineID,
|
||||
MachineName: machineName,
|
||||
Hook: ctr.Container.Config.Labels[api.LabelHook],
|
||||
}
|
||||
enrichedStream := logsStreamWithServiceMetadata(stream, metadata)
|
||||
ctrStreams = append(ctrStreams, enrichedStream)
|
||||
|
||||
Reference in New Issue
Block a user