22 lines
540 B
Python
22 lines
540 B
Python
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)
|