Skip to content

Commit 6257f3a

Browse files
authored
Merge pull request #86 from Materials-Data-Science-and-Informatics/fix/log_format
Fix/log format
2 parents 77c9345 + 0972820 commit 6257f3a

6 files changed

Lines changed: 18 additions & 8 deletions

File tree

.somesy.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "somesy"
3-
version = "0.4.1"
3+
version = "0.4.2"
44
description = "A CLI tool for synchronizing software project metadata."
55
keywords = ["metadata", "FAIR"]
66
license = "MIT"
@@ -29,6 +29,7 @@ orcid = "https://orcid.org/0000-0002-5077-7497"
2929

3030
contribution = "Concepts, tool development and enhancement, documentation."
3131
contribution_begin = "2023-03-01"
32+
contribution_end = "2023-04-30"
3233
contribution_types = ["ideas", "code", "test", "review", "doc"]
3334

3435
author = true

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ Here we provide notes that summarize the most important changes in each released
44

55
Please consult the changelog to inform yourself about breaking changes and security issues.
66

7-
## [v0.4.1](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.4.1) <small>(2024-02-??)</small> { id="0.4.1" }
7+
## [v0.4.2](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.4.2) <small>(2024-04-30)</small> { id="0.4.2" }
8+
9+
* fix rich logging bug for error messages and tracebacks
10+
11+
## [v0.4.1](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.4.1) <small>(2024-04-08)</small> { id="0.4.1" }
812

913
* fix package.json and mkdocs.yml validation bug about optional fields
1014

11-
## [v0.4.0](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.4.0) <small>(2024-02-??)</small> { id="0.4.0" }
15+
## [v0.4.0](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.4.0) <small>(2024-03-08)</small> { id="0.4.0" }
1216

1317
* added separate `documentation` URL to Project metadata model
1418
* added support for Julia `Project.toml` file

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ type: software
33
message: If you use this software, please cite it using this metadata.
44

55
title: somesy
6-
version: 0.4.1
6+
version: 0.4.2
77
abstract: A CLI tool for synchronizing software project metadata.
88
url: https://materials-data-science-and-informatics.github.io/somesy
99
repository-code: https://github.com/Materials-Data-Science-and-Informatics/somesy

codemeta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
],
2626
"name": "somesy",
2727
"description": "A CLI tool for synchronizing software project metadata.",
28-
"version": "0.4.1",
28+
"version": "0.4.2",
2929
"keywords": [
3030
"metadata",
3131
"FAIR"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "somesy"
3-
version = "0.4.1"
3+
version = "0.4.2"
44
description = "A CLI tool for synchronizing software project metadata."
55
authors = ["Mustafa Soylu <m.soylu@fz-juelich.de>", "Anton Pirogov <a.pirogov@fz-juelich.de>"]
66
maintainers = ["Mustafa Soylu <m.soylu@fz-juelich.de>"]

src/somesy/cli/util.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import typer
77
import wrapt
8+
from rich.markup import escape
89
from rich.pretty import pretty_repr
910

1011
from somesy.core.core import discover_input
@@ -33,8 +34,12 @@ def wrap_exceptions(wrapped, instance, args, kwargs):
3334
return wrapped(*args, **kwargs)
3435

3536
except Exception as e:
36-
logger.error(f"[bold red]Error: {e}[/bold red]")
37-
logger.debug(f"[red]{traceback.format_exc()}[/red]")
37+
# Escape the error message to prevent Rich from misinterpreting it
38+
escaped_error_message = escape(str(e))
39+
escaped_traceback = escape(traceback.format_exc())
40+
41+
logger.error(f"[bold red]Error: {escaped_error_message}[/bold red]")
42+
logger.debug(f"[red]{escaped_traceback}[/red]")
3843
raise typer.Exit(code=1) from e
3944

4045

0 commit comments

Comments
 (0)