Skip to content

Commit 5484d42

Browse files
authored
Merge pull request #8 from LaunchPlatform/bugfix-7-fix-format-log-stdout-output
Fix #7 output log to stderr instead of stdout
2 parents 9640eeb + 4466b14 commit 5484d42

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

beanhub_cli/cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33

44
import click
5+
from rich.logging import Console
56
from rich.logging import RichHandler
67

78
from .aliase import AliasedGroup
@@ -25,10 +26,11 @@
2526
def cli(env: Environment, log_level: str):
2627
env.log_level = LogLevel(log_level)
2728
FORMAT = "%(message)s"
29+
console = Console(stderr=True)
2830
logging.basicConfig(
2931
level=LOG_LEVEL_MAP[env.log_level],
3032
format=FORMAT,
3133
datefmt="[%X]",
32-
handlers=[RichHandler()],
34+
handlers=[RichHandler(console=console)],
3335
force=True,
3436
)

tests/forms/test_validator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,4 @@ def test_validate_cmd_with_invalid_doc(
149149
with switch_cwd(tmp_path):
150150
result = cli_runner.invoke(cli, ["form", "validate"])
151151
assert result.exit_code == -1
152-
assert expected_error in result.stdout
152+
assert expected_error in result.stderr

0 commit comments

Comments
 (0)