temptours+tours
This commit is contained in:
21
engine/logger.py
Normal file
21
engine/logger.py
Normal file
@ -0,0 +1,21 @@
|
||||
import sys
|
||||
|
||||
# ENGINE_MODE = "DEV" ou "PROD"
|
||||
ENGINE_MODE = "DEV" # change à PROD sur ton serveur
|
||||
|
||||
def log_debug(msg: str):
|
||||
if ENGINE_MODE == "DEV":
|
||||
print(f"[DEBUG] {msg}")
|
||||
|
||||
def log_info(msg: str):
|
||||
if ENGINE_MODE == "DEV":
|
||||
print(f"[INFO] {msg}")
|
||||
|
||||
def log_warn(msg: str):
|
||||
# On affiche les warnings en DEV mais pas en PROD
|
||||
if ENGINE_MODE == "DEV":
|
||||
print(f"[WARN] {msg}")
|
||||
|
||||
def log_error(msg: str):
|
||||
# Toujours afficher les erreurs, même en production
|
||||
print(f"[ERROR] {msg}", file=sys.stderr)
|
||||
Reference in New Issue
Block a user