-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Replace Halo with rich for CLI spinner and progress tracking (#256)
* First pass, using rich for CLI spinner and logging * Replace ProgressIndicator class * Review feedback Co-authored-by: Honoré Hounwanou <[email protected]> * Consistency Co-authored-by: Honoré Hounwanou <[email protected]> * Tweak progress columns. Replace tqdm. --------- Co-authored-by: Honoré Hounwanou <[email protected]>
- Loading branch information
1 parent
41985ca
commit 5520fe8
Showing
17 changed files
with
282 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
import os | ||
import sys | ||
import logging | ||
|
||
from loguru import logger | ||
from rich.logging import RichHandler | ||
|
||
from ._version import __version__ | ||
from .loader import load_benchmark, load_competition, load_dataset | ||
|
||
__all__ = ["load_dataset", "load_benchmark", "load_competition", "__version__"] | ||
|
||
# Configure the default logging level | ||
os.environ["LOGURU_LEVEL"] = os.environ.get("LOGURU_LEVEL", "INFO") | ||
logger.remove() | ||
logger.add(sys.stderr, level=os.environ["LOGURU_LEVEL"]) | ||
# Polaris specific logger | ||
logger = logging.getLogger(__name__) | ||
|
||
# Only add handler if the logger has not already been configured externally | ||
if not logger.handlers: | ||
handler = RichHandler(rich_tracebacks=True) | ||
handler.setFormatter(logging.Formatter("%(message)s", datefmt="[%Y-%m-%d %X]")) | ||
logger.addHandler(handler) | ||
logger.setLevel(logging.INFO) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.