This repository has been archived by the owner on Oct 10, 2023. It is now read-only.
Use fstring instead of multiple arg for logging and some refactoring #107
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The logging module expects a single parameter for all of its methods debug, error, and info. Thus converted all multi-params to fstring to fix the following error:
[2023-10-03 19:18:12] - flojoy - ERROR - not all arguments converted during string formatting [2023-10-03 19:18:12] - flojoy - ERROR - error occured while running the node [2023-10-03 19:18:12] - flojoy - DEBUG - Traceback (most recent call last): File "H:\flojoy\studio\venv\lib\site-packages\flojoy\flojoy_python.py", line 183, in wrapper logger.debug("previous jobs:", previous_jobs) File "F:\programs\Python\lib\logging\__init__.py", line 1465, in debug self._log(DEBUG, msg, args, **kwargs) File "F:\programs\Python\lib\logging\__init__.py", line 1624, in _log self.handle(record) File "F:\programs\Python\lib\logging\__init__.py", line 1634, in handle self.callHandlers(record) File "F:\programs\Python\lib\logging\__init__.py", line 1696, in callHandlers hdlr.handle(record) File "F:\programs\Python\lib\logging\__init__.py", line 968, in handle self.emit(record) File "H:\flojoy\studio\captain\utils\logger.py", line 51, in emit log_entry = self.format(record) File "F:\programs\Python\lib\logging\__init__.py", line 943, in format return fmt.format(record) File "F:\programs\Python\lib\logging\__init__.py", line 678, in format record.message = record.getMessage() File "F:\programs\Python\lib\logging\__init__.py", line 368, in getMessage msg = msg % self.args TypeError: not all arguments converted during string formatting