diff options
-rw-r--r-- | synapse/app/homeserver.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py index e11c81d642..8034113e47 100644 --- a/synapse/app/homeserver.py +++ b/synapse/app/homeserver.py @@ -456,13 +456,16 @@ def setup_viztracer() -> None: def eprint(msg: str) -> None: print(msg, file=sys.stderr) - if os.environ.get("SYNAPSE_VIZTRACER", ""): - eprint("SYNAPSE_VIZTRACER is set. Installing VizTracer hooks.") + viztracer_output_path = os.environ.get("SYNAPSE_VIZTRACER", "") + if viztracer_output_path: + eprint( + f"SYNAPSE_VIZTRACER is set. Installing VizTracer hooks to output to {viztracer_output_path}." + ) try: from viztracer import VizTracer - VizTracer().install() + VizTracer(output_file=viztracer_output_path).install() except ImportError: eprint("VizTracer could not be imported: can't install hooks.") else: |