Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/backend/base/langflow/logging/logger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from lfx.log.logger import configure, logger

__all__ = ["configure", "logger"]
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,10 @@
def test_no_conflict_with_lfx_logging():
"""Test that langflow.logging and lfx.logging don't conflict."""
# Import both
from langflow.logging import configure as lf_configure
from langflow.logging import logger as lf_logger

from lfx.logging import configure as lfx_configure
from lfx.logging import logger as lfx_logger

Check failure on line 73 in src/backend/tests/unit/test_langflow_logging_compatibility.py

View workflow job for this annotation

GitHub Actions / Ruff Style Check (3.13)

Ruff (I001)

src/backend/tests/unit/test_langflow_logging_compatibility.py:70:5: I001 Import block is un-sorted or un-formatted

Check failure on line 73 in src/backend/tests/unit/test_langflow_logging_compatibility.py

View workflow job for this annotation

GitHub Actions / Ruff Style Check (3.13)

Ruff (I001)

src/backend/tests/unit/test_langflow_logging_compatibility.py:70:5: I001 Import block is un-sorted or un-formatted

# They should be the same underlying objects since langflow.logging imports from lfx.log.logger
# and lfx.logging re-exports from lfx.log.logger
Expand All @@ -91,10 +90,9 @@

def test_langflow_logging_imports_from_lfx():
"""Test that langflow.logging correctly imports from lfx."""
from langflow.logging import configure, logger

from lfx.log.logger import configure as lfx_configure
from lfx.log.logger import logger as lfx_logger

Check failure on line 95 in src/backend/tests/unit/test_langflow_logging_compatibility.py

View workflow job for this annotation

GitHub Actions / Ruff Style Check (3.13)

Ruff (I001)

src/backend/tests/unit/test_langflow_logging_compatibility.py:93:5: I001 Import block is un-sorted or un-formatted

Check failure on line 95 in src/backend/tests/unit/test_langflow_logging_compatibility.py

View workflow job for this annotation

GitHub Actions / Ruff Style Check (3.13)

Ruff (I001)

src/backend/tests/unit/test_langflow_logging_compatibility.py:93:5: I001 Import block is un-sorted or un-formatted

# langflow.logging should import equivalent objects from lfx.log.logger
# Due to module initialization order, object identity may vary
Expand All @@ -118,13 +116,12 @@
# 3. Both should work without conflicts

# Import from all paths
from langflow.logging import configure as lf_configure
from langflow.logging import logger as lf_logger

from lfx.log.logger import configure as orig_configure
from lfx.log.logger import logger as orig_logger
from lfx.logging import configure as lfx_configure
from lfx.logging import logger as lfx_logger

Check failure on line 124 in src/backend/tests/unit/test_langflow_logging_compatibility.py

View workflow job for this annotation

GitHub Actions / Ruff Style Check (3.13)

Ruff (I001)

src/backend/tests/unit/test_langflow_logging_compatibility.py:119:5: I001 Import block is un-sorted or un-formatted

Check failure on line 124 in src/backend/tests/unit/test_langflow_logging_compatibility.py

View workflow job for this annotation

GitHub Actions / Ruff Style Check (3.13)

Ruff (I001)

src/backend/tests/unit/test_langflow_logging_compatibility.py:119:5: I001 Import block is un-sorted or un-formatted

# All should be callable/have expected methods
assert callable(lf_configure)
Expand Down Expand Up @@ -158,6 +155,7 @@
# Test that langflow.logging can be used in component code created via create_class
code = dedent("""
from langflow.logging import logger, configure
from langflow.logging.logger import logger
from langflow.custom import Component

class TestLangflowLoggingComponent(Component):
Expand Down
Loading