Appearance
Logging API Reference
Unified logging configuration for AGB SDK using loguru.
This module provides a centralized logging configuration with beautiful formatting and structured output for different log levels.
AGBLogger
python
class AGBLogger()AGB SDK Logger with beautiful formatting.
setup
python
@classmethod
def setup(cls,
level: str = "INFO",
log_file: Optional[Union[str, Path]] = None,
enable_console: bool = True,
enable_file: bool = True,
rotation: str = "10 MB",
retention: str = "30 days") -> NoneSetup the logger with custom configuration.
Arguments:
levelstr - Log level (DEBUG, INFO, WARNING, ERROR, CRITICAL). Defaults to "INFO".log_fileOptional[Union[str, Path]] - Path to log file (optional). Defaults to None.enable_consolebool - Whether to enable console logging. Defaults to True.enable_filebool - Whether to enable file logging. Defaults to True.rotationstr - Log file rotation size. Defaults to "10 MB".retentionstr - Log file retention period. Defaults to "30 days".
get_logger
python
@classmethod
def get_logger(cls, name: Optional[str] = None)Get a logger instance.
Arguments:
nameOptional[str] - Logger name (optional). Defaults to None.
Returns:
logger: Configured logger instance.
set_level
python
@classmethod
def set_level(cls, level: str) -> NoneSet the logging level.
Arguments:
levelstr - New log level.
log
python
log = AGBLogger.get_logger("agb")get_logger
python
def get_logger(name: str)Convenience function to get a named logger.
Arguments:
namestr - Logger name.
Returns:
logger: Named logger instance.
log_api_call
python
def log_api_call(api_name: str, request_data: str = "") -> NoneLog API call with consistent formatting.
Arguments:
api_namestr - Name of the API being called.request_datastr - Data sent with the request. Defaults to "".
log_api_response
python
def log_api_response(response_data: str, success: bool = True) -> NoneLog API response with consistent formatting.
Arguments:
response_datastr - Data received in the response.successbool - Whether the API call was successful. Defaults to True.
log_operation_start
python
def log_operation_start(operation: str, details: str = "") -> NoneLog the start of an operation.
Arguments:
operationstr - Name of the operation.detailsstr - Additional details about the operation. Defaults to "".
log_operation_success
python
def log_operation_success(operation: str, result: str = "") -> NoneLog successful operation completion.
Arguments:
operationstr - Name of the operation.resultstr - Result details of the operation. Defaults to "".
log_operation_error
python
def log_operation_error(operation: str, error: str) -> NoneLog operation error.
Arguments:
operationstr - Name of the operation.errorstr - Error message.
log_warning
python
def log_warning(message: str, details: str = "") -> NoneLog warning with consistent formatting.
Arguments:
messagestr - Warning message.detailsstr - Additional details about the warning. Defaults to "".
Documentation generated automatically from source code using pydoc-markdown.