Skip to content

Commit

Permalink
mise a jour
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTraveylan committed Nov 27, 2023
1 parent b40b262 commit 9a23a7e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
Empty file added .env.example
Empty file.
1 change: 0 additions & 1 deletion .env.exemple

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: solgard-bot-last-refactoring
name: <Modify it by your name>
on:
push:
branches: [main]
Expand Down
6 changes: 2 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.formatting.blackArgs": [
"--line-length",
"150"
]
"editor.rulers": [145, 147],
"autoDocstring.docstringFormat": "numpy"
}
9 changes: 9 additions & 0 deletions app/core/logger/logger.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
"""Logger module"""
import logging


class Logger:
"""Singleton Logger class"""

_instance = None
_handlers_set = False

def __new__(cls, *args, **kwargs):
"""Singleton design pattern"""
if cls._instance is None:
cls._instance = super(Logger, cls).__new__(cls)
return cls._instance

def __init__(self, name="Insert logger name here", level=logging.INFO):
"""Initialise le logger"""
self.logger = logging.getLogger(name)
self.logger.setLevel(level)

Expand All @@ -37,4 +42,8 @@ def __init__(self, name="Insert logger name here", level=logging.INFO):
self._handlers_set = True

def get_logger(self):
"""Retourne le logger"""
return self.logger


LOGGER = Logger().get_logger()

0 comments on commit 9a23a7e

Please sign in to comment.