feat(log_system): add USE_COLORS config option for ANSI console color support

- Bump version to 1.5.0 in config.py, log_funcs.py, and logger.py
- Add USE_COLORS = True to core/log_system/config.py
- Import USE_COLORS in log_funcs.py and pass it to the logger context as
  use_colors, honouring AZLOGS_USE_COLORS env var when set
This commit is contained in:
Dariusz L
2026-05-19 07:35:52 +02:00
parent 5b4d82f26f
commit bcd947e37d
3 changed files with 12 additions and 4 deletions
+4 -1
View File
@@ -1,7 +1,7 @@
"""
@author: Azornes
@title: AzLogs
@version: 1.4.1
@version: 1.5.0
@description: Logging Configuration
"""
# Log level for development.
@@ -10,3 +10,6 @@ LOG_LEVEL = "DEBUG"
# Logger module name. Set to None to auto-detect from folder name.
LOG_MODULE_NAME = "MLinker"
# Enable ANSI colors in console logs.
USE_COLORS = True
+7 -2
View File
@@ -1,7 +1,7 @@
"""
@author: Azornes
@title: AzLogs
@version: 1.4.1
@version: 1.5.0
@description: Logging Initializator
"""
@@ -18,7 +18,7 @@ _project_root = None
try:
from .logger import logger, LogLevel, debug, info, warn, error, exception
from .config import LOG_LEVEL, LOG_MODULE_NAME
from .config import LOG_LEVEL, LOG_MODULE_NAME, USE_COLORS
def _find_project_root(start_path):
current = os.path.dirname(os.path.abspath(start_path))
@@ -44,6 +44,11 @@ try:
{
"log_to_file": True,
"log_dir": os.path.join(os.path.dirname(os.path.abspath(__file__)), "logs"),
"use_colors": (
logger.config["use_colors"]
if "AZLOGS_USE_COLORS" in os.environ
else USE_COLORS
),
}
)
+1 -1
View File
@@ -1,7 +1,7 @@
"""
@author: Azornes
@title: AzLogs
@version: 1.4.1
@version: 1.5.0
@description: Logging Setup - Central logging system
Features: