Skip to content

Commit

Permalink
debug logger added
Browse files Browse the repository at this point in the history
  • Loading branch information
mgonzs13 committed Oct 28, 2024
1 parent e220181 commit 196d006
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions yasmin/include/yasmin/yasmin_logs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
fprintf(stderr, "[WARN] " text "\n", ##__VA_ARGS__)
#define YASMIN_LOG_INFO(text, ...) \
fprintf(stderr, "[INFO] " text "\n", ##__VA_ARGS__)
#define YASMIN_LOG_DEBUG(text, ...) \
fprintf(stderr, "[DEBUG] " text "\n", ##__VA_ARGS__)

#endif
12 changes: 8 additions & 4 deletions yasmin/yasmin/yasmin_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,20 @@
import logging

# Define the logging configuration
logging.basicConfig(level=logging.DEBUG, format="%(message)s")
logging.basicConfig(level=logging.NOTSET, format="%(message)s")


def YASMIN_LOG_ERROR(text, *args):
def YASMIN_LOG_ERROR(text: str, *args) -> None:
logging.error("[ERROR] " + text, *args)


def YASMIN_LOG_WARN(text, *args):
def YASMIN_LOG_WARN(text: str, *args) -> None:
logging.warning("[WARN] " + text, *args)


def YASMIN_LOG_INFO(text, *args):
def YASMIN_LOG_INFO(text: str, *args) -> None:
logging.info("[INFO] " + text, *args)


def YASMIN_LOG_DEBUG(text: str, *args) -> None:
logging.info("[DEBUG] " + text, *args)

0 comments on commit 196d006

Please sign in to comment.