from .colors import ConsoleColors, rgb, hex_to_rgb, Theme
from .formatters import GradientFormatter, TimestampFormatter
from .handlers import ConsoleHandler, FileHandler, RotatingFileHandler, JSONHandler
from .logger import Logger
from .extras import ProgressBar, Spinner, Table, Timer, Panel
from .utils import log_calls, timer, LogContext

__version__ = "2.0.0"
__author__ = "ZeoN"
__all__ = [
    "ConsoleColors",
    "rgb",
    "hex_to_rgb",
    "Theme",
    "GradientFormatter",
    "TimestampFormatter",
    "ConsoleHandler",
    "FileHandler",
    "RotatingFileHandler",
    "JSONHandler",
    "Logger",
    "ProgressBar",
    "Spinner",
    "Table",
    "Timer",
    "Panel",
    "log_calls",
    "timer",
    "LogContext",
    "console",
]

console = Logger()

def info(message):
    console.info(message)

def success(message):
    console.success(message)

def warning(message):
    console.warning(message)

def error(message, error=None):
    console.error(message, error)

def debug(message):
    console.debug(message)

def critical(message):
    console.critical(message)

def section(title, start_rgb=(189, 147, 249), end_rgb=(139, 233, 253)):
    console.section(title, start_rgb, end_rgb)

def gradient_print(text, start_rgb, end_rgb):
    console.gradient_print(text, start_rgb, end_rgb)
