diff --git a/aprsd/cli_helper.py b/aprsd/cli_helper.py index a52f260..2e0fb0d 100644 --- a/aprsd/cli_helper.py +++ b/aprsd/cli_helper.py @@ -4,7 +4,7 @@ import typing as t import click from aprsd import config as aprsd_config -from aprsd import log +from aprsd.logging import log F = t.TypeVar("F", bound=t.Callable[..., t.Any]) diff --git a/aprsd/flask.py b/aprsd/flask.py index 77e983b..0be0667 100644 --- a/aprsd/flask.py +++ b/aprsd/flask.py @@ -18,9 +18,10 @@ from werkzeug.security import check_password_hash, generate_password_hash import aprsd from aprsd import client from aprsd import config as aprsd_config -from aprsd import log, messaging, packets, plugin, stats, threads, utils +from aprsd import messaging, packets, plugin, stats, threads, utils from aprsd.clients import aprsis -from aprsd.logging import logging as aprsd_logging +from aprsd.logging import log +from aprsd.logging import rich as aprsd_logging LOG = logging.getLogger("APRSD") diff --git a/aprsd/log.py b/aprsd/logging/log.py similarity index 98% rename from aprsd/log.py rename to aprsd/logging/log.py index 96135f9..855547d 100644 --- a/aprsd/log.py +++ b/aprsd/logging/log.py @@ -5,7 +5,7 @@ import queue import sys from aprsd import config as aprsd_config -from aprsd.logging import logging as aprsd_logging +from aprsd.logging import rich as aprsd_logging LOG = logging.getLogger("APRSD") diff --git a/aprsd/logging/logging.py b/aprsd/logging/rich.py similarity index 100% rename from aprsd/logging/logging.py rename to aprsd/logging/rich.py diff --git a/tests/cmds/test_dev.py b/tests/cmds/test_dev.py index fd2b20a..77793c4 100644 --- a/tests/cmds/test_dev.py +++ b/tests/cmds/test_dev.py @@ -25,7 +25,7 @@ class TestDevTestPluginCommand(unittest.TestCase): return aprsd_config.Config(config) @mock.patch("aprsd.config.parse_config") - @mock.patch("aprsd.log.setup_logging") + @mock.patch("aprsd.logging.log.setup_logging") def test_no_login(self, mock_logging, mock_parse_config): """Make sure we get an error if there is no login and config.""" @@ -43,7 +43,7 @@ class TestDevTestPluginCommand(unittest.TestCase): assert "Must set --aprs_login or APRS_LOGIN" in result.output @mock.patch("aprsd.config.parse_config") - @mock.patch("aprsd.log.setup_logging") + @mock.patch("aprsd.logging.log.setup_logging") def test_no_plugin_arg(self, mock_logging, mock_parse_config): """Make sure we get an error if there is no login and config.""" diff --git a/tests/cmds/test_send_message.py b/tests/cmds/test_send_message.py index e67e8f1..7a4b22e 100644 --- a/tests/cmds/test_send_message.py +++ b/tests/cmds/test_send_message.py @@ -25,7 +25,7 @@ class TestSendMessageCommand(unittest.TestCase): return aprsd_config.Config(config) @mock.patch("aprsd.config.parse_config") - @mock.patch("aprsd.log.setup_logging") + @mock.patch("aprsd.logging.log.setup_logging") def test_no_login(self, mock_logging, mock_parse_config): """Make sure we get an error if there is no login and config.""" @@ -43,7 +43,7 @@ class TestSendMessageCommand(unittest.TestCase): assert "Must set --aprs_login or APRS_LOGIN" in result.output @mock.patch("aprsd.config.parse_config") - @mock.patch("aprsd.log.setup_logging") + @mock.patch("aprsd.logging.log.setup_logging") def test_no_password(self, mock_logging, mock_parse_config): """Make sure we get an error if there is no password and config.""" @@ -58,7 +58,7 @@ class TestSendMessageCommand(unittest.TestCase): assert "Must set --aprs-password or APRS_PASSWORD" in result.output @mock.patch("aprsd.config.parse_config") - @mock.patch("aprsd.log.setup_logging") + @mock.patch("aprsd.logging.log.setup_logging") def test_no_tocallsign(self, mock_logging, mock_parse_config): """Make sure we get an error if there is no tocallsign.""" @@ -76,7 +76,7 @@ class TestSendMessageCommand(unittest.TestCase): assert "Error: Missing argument 'TOCALLSIGN'" in result.output @mock.patch("aprsd.config.parse_config") - @mock.patch("aprsd.log.setup_logging") + @mock.patch("aprsd.logging.log.setup_logging") def test_no_command(self, mock_logging, mock_parse_config): """Make sure we get an error if there is no command."""