-
Notifications
You must be signed in to change notification settings - Fork 30
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 #3 from devansh-shah-11/merge-code-mark-1
Merge code mark 1
- Loading branch information
Showing
6 changed files
with
171 additions
and
89 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import logging | ||
|
||
|
||
def init_logging_config(): | ||
class CustomFormatter(logging.Formatter): | ||
def __init__(self, file=False): | ||
super().__init__() | ||
yellow = "\x1b[36;10m" if not file else "" | ||
blue = "\x1b[35;10m" if not file else "" | ||
green = "\x1b[32;10m" if not file else "" | ||
red = "\x1b[31;10m" if not file else "" | ||
bold_red = "\x1b[31;1m" if not file else "" | ||
reset = "\x1b[0m" if not file else "" | ||
log = "%(asctime)s (%(filename)s:%(lineno)d) - %(levelname)s: " | ||
msg = reset + "%(message)s" | ||
|
||
self.FORMATS = { | ||
logging.DEBUG: blue + log + msg, | ||
logging.INFO: green + log + msg, | ||
logging.WARNING: yellow + log + msg, | ||
logging.ERROR: red + log + msg, | ||
logging.CRITICAL: bold_red + log + msg, | ||
} | ||
|
||
def format(self, record): | ||
log_fmt = self.FORMATS.get(record.levelno) | ||
formatter = logging.Formatter(log_fmt) | ||
return formatter.format(record) | ||
|
||
logger = logging.getLogger() | ||
logger.setLevel(logging.DEBUG) | ||
|
||
stderr_handler = logging.StreamHandler() | ||
stderr_handler.setLevel(logging.DEBUG) | ||
stderr_handler.setFormatter(CustomFormatter()) | ||
logger.addHandler(stderr_handler) | ||
|
||
file_handler = logging.FileHandler("app.log", mode="w") | ||
file_handler.setLevel(logging.DEBUG) | ||
file_handler.setFormatter(CustomFormatter(True)) | ||
logger.addHandler(file_handler) |
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,18 @@ | ||
## [Unreleased] | ||
## [0.0.1] - 2024-03-08 - 2:30 | ||
|
||
### Added | ||
- Implemented all test cases in `test_face_cycle` | ||
- Implemented mock test cases for `test_face_cycle` to work on online runners | ||
- Implemented mock test cases for `test_face_cycle` to work on online runners | ||
|
||
## [0.1.0] - 2024-03-08 - 17:10 | ||
|
||
### Added | ||
- Updated `create_new_faceEntry` function in [`route.py`](route/route.py) to handle multiple images for each employee. | ||
- Updated `test_face_lifecycle` function in [`test_face_cycle.py`](testing/test_face_cycle.py) to handle multiple images for each employee in the test data. | ||
|
||
### Changed | ||
- Modified the `Employee` and `UpdateEmployee` models in [`route.py`](route/route.py) to include a list of images instead of a single image. | ||
- Adjusted the mock data and assertions in [`test_face_cycle.py`](testing/test_face_cycle.py) to handle multiple images for each employee. | ||
|
||
### Fixed | ||
- Resolved an issue where the `create_new_faceEntry` function in [`route.py`](route/route.py) was not correctly processing multiple images for each employee. |
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
Oops, something went wrong.