Skip to content

Commit

Permalink
black and flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
slabasan committed Apr 9, 2024
1 parent ca867fe commit 459ca9c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/python/perfflowaspect/advice_chrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def sync_event(cls, pointcut, *args, **kwargs):
except KeyError:
raise ValueError("Invalid pointcut: {}".format(pointcut))
event = cls.create_sync_event(*args, phase, **kwargs)
if ChromeTracingAdvice.array_format == True:
if ChromeTracingAdvice.array_format:
cls.__flush_log(json.dumps(event) + ",")
else:
cls.__flush_log(" " + json.dumps(event) + ",")
Expand All @@ -264,7 +264,7 @@ def async_event(cls, pointcut, *args, **kwargs):
except KeyError:
raise ValueError("Invalid pointcut: {}".format(pointcut))
event = cls.create_async_event(*args, phase, **kwargs)
if ChromeTracingAdvice.array_format == True:
if ChromeTracingAdvice.array_format:
cls.__flush_log(json.dumps(event) + ",")
else:
cls.__flush_log(" " + json.dumps(event) + ",")
Expand All @@ -284,15 +284,15 @@ def __flush_log(s):
formatter = logging.Formatter("%(message)s")
fh.setFormatter(formatter)
ChromeTracingAdvice.logger.addHandler(fh)
if ChromeTracingAdvice.array_format == True:
if ChromeTracingAdvice.array_format:
ChromeTracingAdvice.logger.debug("[")
else:
ChromeTracingAdvice.logger.debug("{")
ChromeTracingAdvice.logger.debug(" \"displayTimeUnit\": \"us\",")
ChromeTracingAdvice.logger.debug(" \"otherData\": {")
ChromeTracingAdvice.logger.debug(' "displayTimeUnit": "us",')
ChromeTracingAdvice.logger.debug(' "otherData": {')
ChromeTracingAdvice.logger.debug("")
ChromeTracingAdvice.logger.debug(" },")
ChromeTracingAdvice.logger.debug(" \"traceEvents\": [")
ChromeTracingAdvice.logger.debug(' "traceEvents": [')
ChromeTracingAdvice.logger.debug(s)

@staticmethod
Expand All @@ -307,7 +307,7 @@ def __update_log(func, event_type, event_args=None, event_ts=None, event_dur=Non
event["ts"] = event_ts
if event_dur is not None:
event["dur"] = event_dur
if ChromeTracingAdvice.array_format == True:
if ChromeTracingAdvice.array_format:
ChromeTracingAdvice.__flush_log(json.dumps(event) + ",")
else:
ChromeTracingAdvice.__flush_log(" " + json.dumps(event) + ",")
Expand All @@ -330,7 +330,7 @@ def __update_async_log(
event["ts"] = event_ts
if event_dur is not None:
event["dur"] = event_dur
if ChromeTracingAdvice.array_format == True:
if ChromeTracingAdvice.array_format:
ChromeTracingAdvice.__flush_log(json.dumps(event) + ",")
else:
ChromeTracingAdvice.__flush_log(" " + json.dumps(event) + ",")
Expand Down

0 comments on commit 459ca9c

Please sign in to comment.