Skip to content

Commit 6a60187

Browse files
authored
fix(structured_logs): Remove prefix (#443)
* fix prefix issue * changelog
1 parent a3d9711 commit 6a60187

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111
- Added multi-branch indexing support for Gerrit. [#433](https://github.com/sourcebot-dev/sourcebot/pull/433)
1212

13+
### Fixed
14+
- Removed prefix from structured log output. [#443](https://github.com/sourcebot-dev/sourcebot/pull/443)
15+
1316
## [4.6.3] - 2025-08-04
1417

1518
### Fixed

prefix-output.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
#!/bin/sh
22

33
# @see : https://github.com/Supervisor/supervisor/issues/553#issuecomment-1353523182
4-
exec 1> >( perl -ne '$| = 1; print "['"${SUPERVISOR_PROCESS_NAME}"'] | $_"' >&1)
5-
exec 2> >( perl -ne '$| = 1; print "['"${SUPERVISOR_PROCESS_NAME}"'] | $_"' >&2)
64

7-
exec "$@"
5+
# Check if structured logging is enabled
6+
if [ "${SOURCEBOT_STRUCTURED_LOGGING_ENABLED}" = "true" ]; then
7+
# Don't prefix output, just execute the command directly
8+
exec "$@"
9+
else
10+
# Apply prefix to output
11+
exec 1> >( perl -ne '$| = 1; print "['"${SUPERVISOR_PROCESS_NAME}"'] | $_"' >&1)
12+
exec 2> >( perl -ne '$| = 1; print "['"${SUPERVISOR_PROCESS_NAME}"'] | $_"' >&2)
13+
14+
exec "$@"
15+
fi

0 commit comments

Comments
 (0)