[diffusion] log: minor improve logging (#13735)

This commit is contained in:
Mick
2025-11-21 23:01:23 +08:00
committed by GitHub
parent 1776dce557
commit aa6e2c8aa0
4 changed files with 9 additions and 12 deletions

View File

@@ -6,7 +6,6 @@ import os
import subprocess
import sys
import time
import traceback
from datetime import datetime
from functools import lru_cache
from pathlib import Path
@@ -16,6 +15,7 @@ from dateutil.tz import UTC
import sglang
import sglang.multimodal_gen.envs as envs
from sglang.multimodal_gen.runtime.utils.logging_utils import _SGLDiffusionLogger
@dataclasses.dataclass
@@ -123,7 +123,7 @@ class StageProfiler:
def __init__(
self,
stage_name: str,
logger: logging.Logger,
logger: _SGLDiffusionLogger,
timings: Optional["RequestTimings"],
simple_log: bool = False,
):
@@ -131,7 +131,6 @@ class StageProfiler:
self.timings = timings
self.logger = logger
self.simple_log = simple_log
self.logger = logging.getLogger(__name__)
self.start_time = 0.0
# Check env var at runtime to ensure we pick up changes (e.g. from CLI args)
@@ -158,13 +157,8 @@ class StageProfiler:
self.stage_name,
execution_time_s * 1000,
exc_val,
exc_info=True,
)
if self.metrics_enabled:
self.logger.error(
"[%s] Traceback: %s",
self.stage_name,
"".join(traceback.format_tb(exc_tb)),
)
return False
if self.simple_log: