Skip to content

Commit

Permalink
CommonClient: fix json prints not being logged in UI mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Berserker66 committed Oct 2, 2023
1 parent 485aa23 commit f9d3ea1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions CommonClient.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from __future__ import annotations

import copy
import logging
import asyncio
import urllib.parse
Expand Down Expand Up @@ -377,10 +379,9 @@ def on_print(self, args: dict):

def on_print_json(self, args: dict):
if self.ui:
self.ui.print_json(args["data"])
else:
text = self.jsontotextparser(args["data"])
logger.info(text)
self.ui.print_json(copy.deepcopy(args["data"]))
text = self.jsontotextparser(args["data"])
logger.info(text)

def on_package(self, cmd: str, args: dict):
"""For custom package handling in subclasses."""
Expand Down

0 comments on commit f9d3ea1

Please sign in to comment.