Skip to content

Commit

Permalink
Fixed double logs
Browse files Browse the repository at this point in the history
  • Loading branch information
tombaeyens committed Feb 15, 2025
1 parent 4a92875 commit 1b3cd0b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
10 changes: 0 additions & 10 deletions myds.yml

This file was deleted.

5 changes: 2 additions & 3 deletions soda-core/src/soda_core/common/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def debug(
)

def __str__(self) -> str:
return "\n".join([str(log) for log in self.logs])
return super().__str__() + "\n".join([str(log) for log in self.logs])

def has_errors(self) -> bool:
return any(log.level == ERROR for log in self.logs)
Expand All @@ -165,8 +165,7 @@ def get_errors(self) -> list[Log]:
return [log for log in self.logs if log.level == ERROR]

def __log(self, log: Log) -> None:
if log.level > DEBUG:
self.logs.append(log)
self.logs.append(log)
self.__log_to_python_logging(log)

def __log_to_python_logging(self, log: Log) -> None:
Expand Down
4 changes: 3 additions & 1 deletion soda-core/src/soda_core/contracts/contract_verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,9 @@ def passed(self) -> bool:
return not self.failed()

def __str__(self) -> str:
log_lines: list[str] = [str(log) for log in self.logs.logs]
# TODO consider if the logs should be displayed here as well.
# I ve removed them because they were printed double in the soda cli
log_lines: list[str] = []

failed_count: int = 0
not_evaluated_count: int = 0
Expand Down

0 comments on commit 1b3cd0b

Please sign in to comment.