Skip to content

JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.

Python
730 B
Raw Blame
import logging

from jiuwenswarm.common import utils


def test_log_level_environment_enables_debug_for_all_runtime_handlers(monkeypatch):
    monkeypatch.setattr(
        utils,
        "_load_logging_config_from_yaml",
        lambda: {
            "level": "INFO",
            "console_level": "INFO",
            "gateway": "INFO",
            "channel": "INFO",
            "agent_server": "INFO",
            "full": "INFO",
        },
    )
    monkeypatch.setenv("LOG_LEVEL", "DEBUG")

    levels = utils._resolve_logging_levels(None)

    assert levels == utils.LoggingLevels(
        logging.DEBUG,
        logging.DEBUG,
        logging.DEBUG,
        logging.DEBUG,
        logging.DEBUG,
        logging.DEBUG,
    )