feat(logs): include hook information in log entry formatting

This commit is contained in:
Pasha Sviderski
2026-04-22 13:55:42 +10:00
parent 303c8e4506
commit 56a54ab3fd
3 changed files with 10 additions and 3 deletions
+2
View File
@@ -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.
+1
View File
@@ -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)