Skip to content

Commit

Permalink
when the log() is called, the content is also printed to the console
Browse files Browse the repository at this point in the history
(cherry picked from commit e572d08)
  • Loading branch information
yimelia committed Nov 23, 2020
1 parent 2ed128c commit b7d98f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions airtest/core/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,16 @@ def log(arg, timestamp=None, desc="", snapshot=False):
"name": desc or arg.__class__.__name__,
"traceback": trace_msg,
}, depth=depth, timestamp=timestamp)
G.LOGGING.error(trace_msg)
elif isinstance(arg, six.string_types):
# 普通文本log内容放在"log"里,如果有trace内容放在"traceback"里
# 在报告中,假如"traceback"有内容,将会被识别为报错,这个步骤会被判定为不通过
G.LOGGER.log("info", {"name": desc or arg, "traceback": None, "log": arg}, depth=depth, timestamp=timestamp)
G.LOGGING.info(arg)
else:
G.LOGGER.log("info", {"name": desc or repr(arg), "traceback": None, "log": repr(arg)}, depth=depth,
timestamp=timestamp)
G.LOGGING.info(repr(arg))


def logwrap(f):
Expand Down

0 comments on commit b7d98f6

Please sign in to comment.