-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/66 introduce logging config #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
a406467
#64 - Introduce the pylint into project
miroslavpojer b2213d0
- Add check for case when no python files changed in PR.
miroslavpojer b2a2c5e
- Debug step code.
miroslavpojer f179eb1
- Debug step code.
miroslavpojer 444ad7e
- Debug step code.
miroslavpojer a76b388
- Debug step code.
miroslavpojer f22da73
- Debug step code.
miroslavpojer 02ef095
- Debug step code.
miroslavpojer 1bc2528
- Fixed review comments.
miroslavpojer f4b1058
- Updated code by pylint proposals.
miroslavpojer 6bc19d2
- Updated of requirements.txt.
miroslavpojer 322cee1
#66 - Introduce logging config
miroslavpojer 96ce07d
- Fixing PR review comments.
miroslavpojer 195bb58
- Fixing PR review comments.
miroslavpojer 299441a
- Fixing PR review comments.
miroslavpojer d26ff7d
- Fixing PR review comments.
miroslavpojer 3564a0b
- Switch last logging code to logger.
miroslavpojer 3762c8e
- Experiment with CI log output.
miroslavpojer f4c9762
- Experiment with CI log output.
miroslavpojer a57bd76
- Experiment with CI log output.
miroslavpojer 8410e96
- Experiment with CI log output.
miroslavpojer c68bc26
- Experiment with CI log output.
miroslavpojer 531462b
- Experiment with CI log output.
miroslavpojer c383f13
- Experiment with CI log output.
miroslavpojer 0e56938
- Experiment with CI log output.
miroslavpojer edd4aab
- Experiment with CI log output.
miroslavpojer 7f8de0f
- Experiment with CI log output.
miroslavpojer a88586b
- Experiment with CI log output.
miroslavpojer 13e1a17
- Experiment with CI log output.
miroslavpojer 27f4b05
- Experiment with CI log output.
miroslavpojer dc6066b
- Experiment with CI log output.
miroslavpojer 1dc9aaa
- Experiment with CI log output.
miroslavpojer 3a0e91a
- Experiment with CI log output.
miroslavpojer 9fd519a
- Fix review comments.
miroslavpojer 8c34530
Merge branch 'refs/heads/feature/64-Introduce-the-pylint-into-project…
miroslavpojer 3bfafc9
Merge branch 'refs/heads/master' into feature/66-Introduce-logging-co…
miroslavpojer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
# limitations under the License. | ||
# | ||
|
||
name: Test | ||
name: Build and Test | ||
on: | ||
pull_request: | ||
branches: | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# | ||
# Copyright 2024 ABSA Group Limited | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
""" | ||
This module contains a method to set up logging in the project. | ||
""" | ||
|
||
import logging | ||
import os | ||
import sys | ||
|
||
|
||
def setup_logging() -> None: | ||
""" | ||
Set up the logging configuration in the project | ||
|
||
@return: None | ||
""" | ||
# Load logging configuration from the environment variables | ||
is_verbose_logging: bool = os.getenv("INPUT_VERBOSE", "false").lower() == "true" | ||
is_debug_mode = os.getenv("RUNNER_DEBUG", "0") == "1" | ||
level = logging.DEBUG if is_verbose_logging or is_debug_mode else logging.INFO | ||
|
||
# Set up the logging configuration | ||
logging.basicConfig( | ||
level=level, | ||
format="%(asctime)s - %(levelname)s - %(message)s", | ||
datefmt="%Y-%m-%d %H:%M:%S", | ||
handlers=[logging.StreamHandler(sys.stdout)], | ||
) | ||
sys.stdout.flush() | ||
|
||
logging.info("Setting up logging configuration") | ||
|
||
if is_debug_mode: | ||
logging.debug("Debug mode enabled by CI runner") | ||
if is_verbose_logging: | ||
logging.debug("Verbose logging enabled") |
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.