Files
loader/src/constants.pyx
T
Oleksandr Bezdieniezhnykh ec5d15b4e7 Add API client and CDN manager implementation
- Introduced `ApiClient` class for handling API interactions, including authentication and resource management.
- Added `CDNManager` class for managing file uploads and downloads to/from a CDN.
- Implemented security features for encryption and decryption of sensitive data.
- Created supporting classes for credentials, user roles, and hardware information retrieval.
- Established constants for configuration and logging.

This commit lays the foundation for resource management and secure communication with the API and CDN services.
2026-04-13 06:45:24 +03:00

38 lines
768 B
Cython

import os
import sys
from loguru import logger
cdef str CDN_CONFIG = "cdn.yaml"
cdef int SMALL_SIZE_KB = 3
_log_dir = os.environ.get("LOG_DIR", "Logs")
logger.remove()
log_format = "[{time:HH:mm:ss} {level}] {message}"
logger.add(
sink=f"{_log_dir}/log_loader_{{time:YYYYMMDD}}.txt",
level="INFO",
format=log_format,
enqueue=True,
rotation="1 day",
retention="30 days",
)
logger.add(
sys.stdout,
level="DEBUG",
format=log_format,
filter=lambda record: record["level"].name in ("INFO", "DEBUG", "SUCCESS"),
colorize=True
)
logger.add(
sys.stderr,
level="WARNING",
format=log_format,
colorize=True
)
cdef log(str log_message):
logger.info(log_message)
cdef logerror(str error):
logger.error(error)