This commit is contained in:
2026-02-22 16:49:10 +00:00
parent a8aba2aee2
commit 285852f04d
2 changed files with 8 additions and 3 deletions
+6 -1
View File
@@ -26,7 +26,12 @@ function formatTimestamp(): string {
function formatContext(context?: LogContext): string {
if (!context || Object.keys(context).length === 0) return '';
return ' ' + JSON.stringify(context);
const lines = Object.entries(context)
.map(([key, value]) => ` ${key}=${value}`)
.join('\n');
return '\n' + lines;
}
function log(level: LogLevel, message: string, context?: LogContext) {
+2 -2
View File
@@ -146,8 +146,8 @@ piRestRouter.get('/pi/sessions/:sessionId', async (ctx: Context) => {
messages,
},
});
} catch (err) {
logger.error('Failed to get session', { sessionId, email: ctx.get('email'), error: String(err) });
} catch {
// Session not found - this is expected for new sessions, don't log as error
return ctx.json({ error: 'Session not found' }, 404);
}
});