Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Allow colored logging in jupyter notebooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenroller committed Aug 29, 2020
1 parent e08125c commit 18bfd46
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions parlai/utils/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@
}


def _is_color_friendly():
try:
__IPYTHON__
return True
except NameError:
return sys.stdout.isatty()


# Some functions in this class assume that ':' will be the separator used in
# the logging formats setup for this class
class ParlaiLogger(logging.Logger):
Expand Down

0 comments on commit 18bfd46

Please sign in to comment.