Skip to content

Commit

Permalink
Update binary logging
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Mar 18, 2024
1 parent de43f83 commit 42801d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions robotframework_reportportal/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

logger = logging.getLogger(__name__)
DATA_SIGN = '${data} = '
TRUNCATION_SIGN = "'..."
TRUNCATION_SIGN = "...'"


def is_binary(iterable: Union[bytes, bytearray, str]) -> bool:
Expand Down Expand Up @@ -114,8 +114,8 @@ def log_message(self, message: Dict) -> None:
if msg.message.startswith(DATA_SIGN):
msg_content = msg.message[len(DATA_SIGN):]
if is_binary(msg_content):
# remove trailing `'"...`, add `'...`
msg.message = DATA_SIGN + str(msg_content.encode('utf-8')[:-5]) + TRUNCATION_SIGN
# remove trailing `'"...`, add `...'`
msg.message = DATA_SIGN + str(msg_content.encode('utf-8'))[:-5] + TRUNCATION_SIGN
logger.debug('ReportPortal - Log Message: {0}'.format(message))
self.service.log(message=msg)

Expand Down

0 comments on commit 42801d3

Please sign in to comment.