Skip to content

Commit

Permalink
fix(v3): Use logger for warning message
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Jul 20, 2023
1 parent 3c6b740 commit dd3d220
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions trame/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
from trame_server import Server, Client
from trame_server.core import set_default_client_type, DEFAULT_CLIENT_TYPE
from trame_client.widgets.core import VirtualNode
Expand All @@ -9,13 +10,17 @@
AVAILABLE_SERVERS = {}
AVAILABLE_CLIENTS = {}

logger = logging.getLogger(__name__)


def trame_3_warning(*args, **kwargs):
print()
print("-" * 80)
print(" !!! You are currently using trame@3 which may break your application !!!")
print("-" * 80)
print(
logger.warn("")
logger.warn("-" * 80)
logger.warn(
" !!! You are currently using trame@3 which may break your application !!!"
)
logger.warn("-" * 80)
logger.warn(
"\n 1. trame@3 only provides by default trame.widgets.[html,client] and remove"
"\n everything else as implicit dependency. Those other widgets will still"
"\n exist and will be supported, but they will need to be defined as a"
Expand Down Expand Up @@ -48,10 +53,10 @@ def trame_3_warning(*args, **kwargs):
"\n b. List the expected dependencies or have a 'trame<3' dependency"
"\n"
)
print("-" * 80)
print(f" => Current client_type default: {DEFAULT_CLIENT_TYPE}")
print("-" * 80)
print(flush=True)
logger.warn("-" * 80)
logger.warn(f" => Current client_type default: {DEFAULT_CLIENT_TYPE}")
logger.warn("-" * 80)
logger.warn("")


# ---------------------------------------------------------
Expand Down

0 comments on commit dd3d220

Please sign in to comment.