Skip to content

Commit

Permalink
fix: display logger messages consistently
Browse files Browse the repository at this point in the history
Display messages from Stan C++ consistently. Previously
logger messages sent with "info" level were shown
differently than messages sent with "warning" level.

Closes #192
  • Loading branch information
riddell-stan committed Jan 19, 2021
1 parent 0f9fd55 commit 46696bc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions stan/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@ def is_iteration_or_elapsed_time_logger_message(msg: simdjson.Object):
if nonstandard_logger_messages:
io.error_line("<comment>Messages received during sampling:</comment>")
for msg in nonstandard_logger_messages:
text = msg["values"][0].replace("info:", " ")
io.error_line(f"{text}")
text = msg["values"][0].replace("info:", " ").replace("error:", " ")
if text.strip():
io.error_line(f"{text}")
progress_bar.display() # re-draw the (complete) progress bar
progress_bar.finish()
io.error_line("\n<info>Done.</info>")
Expand Down

0 comments on commit 46696bc

Please sign in to comment.