Skip to content

Commit 0089b97

Browse files
committed
fixed logging
1 parent 8248cb4 commit 0089b97

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

frontend/streamlit/app.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
layout="wide",
1414
initial_sidebar_state="expanded",
1515
)
16-
pg.run()
17-
print("Current Environment:", Config.ENVIRONMENT)
18-
Config.print_config()
16+
17+
Config.print_config_partial()
18+
19+
pg.run()

frontend/streamlit/config.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
"""Configuration module for ClipABit Streamlit frontend."""
22

33
import os
4+
import logging
5+
import sys
6+
7+
logging.basicConfig(
8+
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
9+
level=logging.INFO,
10+
handlers=[logging.StreamHandler(sys.stdout)]
11+
)
12+
logger = logging.getLogger(__name__)
13+
414

515
class Config:
616
"""Configuration class for environment-based settings."""
@@ -41,9 +51,19 @@ def get_config(cls):
4151
}
4252

4353
@classmethod
44-
def print_config(cls):
54+
def print_config_partial(cls):
55+
"""Print current configuration for debugging."""
56+
config = cls.get_config()
57+
logger.info("Current Configuration:")
58+
logger.info(f" Environment: {config['environment']}")
59+
logger.info(f" App Name: {config['app_name']}")
60+
logger.info(f" Namespace: {config['namespace']}")
61+
62+
63+
@classmethod
64+
def print_config_full(cls):
4565
"""Print current configuration for debugging."""
4666
config = cls.get_config()
47-
print("Current Configuration:")
67+
logger.info("Current Configuration:")
4868
for key, value in config.items():
49-
print(f" {key}: {value}")
69+
logger.info(f" {key}: {value}")

0 commit comments

Comments
 (0)