-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from swimlane/0_1_7
0.1.7
- Loading branch information
Showing
6 changed files
with
64 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[tool.commitizen] | ||
version = "0.1.5" | ||
version = "0.1.6" | ||
version_files = [ | ||
"pyproject.toml:version" | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "atomic-operator-runner" | ||
version = "0.1.6" | ||
version = "0.1.7" | ||
description = "atomic-operator-runner" | ||
authors = ["Josh Rickard <[email protected]>"] | ||
license = "MIT" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
"""Base class for all classes in this project.""" | ||
# Copyright: (c) 2022, Swimlane <[email protected]> | ||
# MIT License (see LICENSE or https://opensource.org/licenses/MIT) | ||
import inspect | ||
import platform | ||
from typing import Dict | ||
|
||
|
@@ -45,3 +46,20 @@ def get_local_system_platform(self) -> str: | |
if os_name == "darwin": | ||
return "macos" | ||
return os_name | ||
|
||
def log(self, val, level="info") -> None: | ||
"""Used to centralize logging across components. | ||
We identify the source of the logging class by inspecting the calling stack. | ||
Args: | ||
val (str): The log value string to output. | ||
level (str, optional): The log level. Defaults to "info". | ||
""" | ||
component = None | ||
parent = inspect.stack()[1][0].f_locals.get("self", None) | ||
component = parent.__class__.__name__ | ||
try: | ||
getattr(getattr(parent, f"_{component}__logger"), level)(val) | ||
except AttributeError as ae: | ||
getattr(self.__logger, level)(val + ae) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters