mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 12:25:22 +00:00
fix prefix issue
This commit is contained in:
parent
a3d9711178
commit
34b1f4976c
1 changed files with 11 additions and 3 deletions
|
|
@ -1,7 +1,15 @@
|
|||
#!/bin/sh
|
||||
|
||||
# @see : https://github.com/Supervisor/supervisor/issues/553#issuecomment-1353523182
|
||||
exec 1> >( perl -ne '$| = 1; print "['"${SUPERVISOR_PROCESS_NAME}"'] | $_"' >&1)
|
||||
exec 2> >( perl -ne '$| = 1; print "['"${SUPERVISOR_PROCESS_NAME}"'] | $_"' >&2)
|
||||
|
||||
exec "$@"
|
||||
# Check if structured logging is enabled
|
||||
if [ "${SOURCEBOT_STRUCTURED_LOGGING_ENABLED}" = "true" ]; then
|
||||
# Don't prefix output, just execute the command directly
|
||||
exec "$@"
|
||||
else
|
||||
# Apply prefix to output
|
||||
exec 1> >( perl -ne '$| = 1; print "['"${SUPERVISOR_PROCESS_NAME}"'] | $_"' >&1)
|
||||
exec 2> >( perl -ne '$| = 1; print "['"${SUPERVISOR_PROCESS_NAME}"'] | $_"' >&2)
|
||||
|
||||
exec "$@"
|
||||
fi
|
||||
Loading…
Reference in a new issue