Refactor logger setup and path handling

Moved sys.path modification from canvas_node.py to __init__.py for better package management. Improved logger formatting for colored output and enhanced file logging configuration with error handling for log directory creation. Added python/__init__.py to make the 'python' directory a package.
This commit is contained in:
Dariusz L
2025-06-28 01:26:33 +02:00
parent 375ed6a2b8
commit d8ebbeea1e
4 changed files with 45 additions and 18 deletions

View File

@@ -1,3 +1,9 @@
import sys
import os
# Add the custom node's directory to the Python path
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from .canvas_node import CanvasNode
CanvasNode.setup_routes()
@@ -12,4 +18,4 @@ NODE_DISPLAY_NAME_MAPPINGS = {
WEB_DIRECTORY = "./js"
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"]
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"]