You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Browser Modules ReportCaller() replaces global log formatter #6335
When K6_BROWSER_LOG_CALLER is set, the browser module will add the function name to log entries.
The way it is implemented right now creates some problems:
We are replacing the global log formatter in ReportCaller()
. This means all previously applied config is discarded (JSON log format, no color etc)
ReportCaller() is called once per browser init which means we are modifying global state concurrently. This is dangerous and unnecessary.
Suggestion:
Make K6_BROWSER_LOG_CALLER a core feature, detached from the browser module and handle it in setupLoggers() where all the other logging setup already takes place. K6_BROWSER_LOG_CALLER is already modifying global behavior outside the browser module so it wouldn't be too big of a change. This allows us to combine the setup with other log related setup and get rid of the concurrency.
Add a new env var K6_LOG_CALLER and remove K6_BROWSER_LOG_CALLER in the next major.
Open Questions
Should the fallback logger also respect K6_BROWSER_LOG_CALLER? (I suggest no)
Should we also log callers when the user selected the raw log format (I suggest no)
Activity