We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3d9711 commit 34b1f49Copy full SHA for 34b1f49
prefix-output.sh
@@ -1,7 +1,15 @@
1
#!/bin/sh
2
3
# @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)
6
7
-exec "$@"
+# Check if structured logging is enabled
+if [ "${SOURCEBOT_STRUCTURED_LOGGING_ENABLED}" = "true" ]; then
+ # 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
15
+fi
0 commit comments