Skip to content

Commit

Permalink
MINOR: Changing NONE to ALL for better clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
vikashplus committed Dec 31, 2023
1 parent 535388e commit cb3c942
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions robohive/utils/prompt_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

"""
Utility script to help with information verbosity produced by RoboHive
To control verbosity set env variable ROBOHIVE_VERBOSITY=NONE(default)/INFO/WARN/ERROR/ONCE/ALWAYS
To control verbosity set env variable ROBOHIVE_VERBOSITY=ALL/INFO/(WARN)/ERROR/ONCE/ALWAYS
"""

from termcolor import cprint
Expand All @@ -18,12 +18,12 @@
# Define verbosity levels
class Prompt(enum.IntEnum):
"""Prompt verbosity types"""
NONE = 0 # default (lowest priority)
ALL = 0 # print everything (lowest priority)
INFO = 1
WARN = 2
ERROR = 3
ONCE = 4 # print only once
ALWAYS = 5 # print always (highest priority)
ONCE = 4 # print: once and higher
ALWAYS = 5 # print: only always (highest priority)


# Prompt Cache (to track for Prompt.ONCE messages)
Expand All @@ -44,14 +44,14 @@ class Prompt(enum.IntEnum):
VERBOSE_MODE = Prompt.WARN
elif VERBOSE_MODE == 'INFO':
VERBOSE_MODE = Prompt.INFO
elif VERBOSE_MODE == 'NONE':
VERBOSE_MODE = Prompt.NONE
elif VERBOSE_MODE == 'ALL':
VERBOSE_MODE = Prompt.ALL
else:
raise TypeError("Unknown ROBOHIVE_VERBOSITY option")


# Programatically override the verbosity
def set_prompt_verbosity(verbose_mode:Prompt=Prompt.NONE):
def set_prompt_verbosity(verbose_mode:Prompt=Prompt.ALL):
global VERBOSE_MODE
VERBOSE_MODE = verbose_mode

Expand Down

0 comments on commit cb3c942

Please sign in to comment.