Skip to content

Commit

Permalink
Add CLI-specific logger
Browse files Browse the repository at this point in the history
  • Loading branch information
augustebaum committed Sep 16, 2024
1 parent 9e77191 commit ef694a0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
12 changes: 6 additions & 6 deletions notebooks/basic_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,39 +301,39 @@ def my_func(x):
# %%
project.put_item(
"my_comment_2",
MediaItem.factory("<p><h2>Integers</h2></p>", media_type="text/html"),
MediaItem.factory("<p><h2>Integers</h1></p>", media_type="text/html"),
)

# %%
project.put_item(
"my_comment_3", MediaItem.factory("<p><h2>Strings</h2></p>", media_type="text/html")
"my_comment_3", MediaItem.factory("<p><h2>Strings</h1></p>", media_type="text/html")
)

# %%
project.put_item(
"my_comment_4",
MediaItem.factory("<p><h2>Many kinds of data</h2></p>", media_type="text/html"),
MediaItem.factory("<p><h2>Many kinds of data</h1></p>", media_type="text/html"),
)

# %%
project.put_item(
"my_comment_5",
MediaItem.factory("<p><h2>Altair plots</h2></p>", media_type="text/html"),
MediaItem.factory("<p><h2>Altair plots</h1></p>", media_type="text/html"),
)

# %%
project.put_item(
"my_comment_6",
MediaItem.factory(
"<p><h2>Scikit-learn models and pipelines</h2></p>", media_type="text/html"
"<p><h2>Scikit-learn models and pipelines</h1></p>", media_type="text/html"
),
)

# %%
project.put_item(
"my_comment_7",
MediaItem.factory(
"<p><h2>Manipulating the skore dashboard</h2></p>", media_type="text/html"
"<p><h2>Manipulating the skore dashboard</h1></p>", media_type="text/html"
),
)

Expand Down
12 changes: 12 additions & 0 deletions src/skore/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
"""Implement skore CLI."""

import logging

formatter = logging.Formatter("%(message)s")

console_handler = logging.StreamHandler()
console_handler.setLevel(logging.INFO)
console_handler.setFormatter(formatter)

logger = logging.getLogger(__name__)
logger.addHandler(console_handler)
logger.propagate = False
2 changes: 1 addition & 1 deletion src/skore/cli/create_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import re
from pathlib import Path

from skore import logger
from skore.cli import logger


class ProjectNameTooLong(Exception):
Expand Down
2 changes: 1 addition & 1 deletion src/skore/cli/launch_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import uvicorn

from skore import logger
from skore.cli import logger
from skore.project import load
from skore.ui.app import create_app

Expand Down
2 changes: 1 addition & 1 deletion src/skore/cli/quickstart_command.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Implement the "quickstart" command."""

from skore import logger
from skore.cli import logger
from skore.cli.create_project import ProjectAlreadyExists, __create
from skore.cli.launch_dashboard import __launch

Expand Down

0 comments on commit ef694a0

Please sign in to comment.