diff --git a/src/python/perfflowaspect/advice_chrome.py b/src/python/perfflowaspect/advice_chrome.py index b68bfd84..74839553 100644 --- a/src/python/perfflowaspect/advice_chrome.py +++ b/src/python/perfflowaspect/advice_chrome.py @@ -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) + ",") @@ -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) + ",") @@ -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 @@ -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) + ",") @@ -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) + ",")