Feat : Log recorder
This commit is contained in:
@@ -3,6 +3,7 @@ import { createHash } from 'node:crypto';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { promisify } from 'node:util';
|
||||
import type { AgentEvent } from '@stream-control/shared';
|
||||
|
||||
const run = promisify(execFile);
|
||||
|
||||
@@ -40,7 +41,7 @@ export function currentBuildId(): string | undefined {
|
||||
export interface UpdateDeps {
|
||||
/** État d'enregistrement : on ne coupe jamais une capture en cours. */
|
||||
recordState(): Promise<{ active: boolean; paused: boolean }>;
|
||||
log(level: 'info' | 'warn' | 'error', message: string): void;
|
||||
log(level: 'info' | 'warn' | 'error', message: string, event?: AgentEvent): void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -127,6 +128,7 @@ export async function selfUpdate(
|
||||
deps.log(
|
||||
'info',
|
||||
`Binaire remplacé : ${previousBuildId} → ${newBuildId}. Redémarrage par le superviseur…`,
|
||||
'agent.updated',
|
||||
);
|
||||
|
||||
// 6. Sortie différée : laisse le temps au résultat de partir vers le serveur.
|
||||
|
||||
Reference in New Issue
Block a user