Update app.py
Browse files
app.py
CHANGED
@@ -7,26 +7,27 @@ import os
|
|
7 |
from dotenv import load_dotenv
|
8 |
from datetime import datetime
|
9 |
|
10 |
-
def setup_logging():
|
11 |
-
log_dir = 'logs'
|
12 |
-
if not os.path.exists(log_dir):
|
13 |
-
os.makedirs(log_dir)
|
14 |
-
current_time = datetime.now().strftime("%Y%m%d_%H%M%S")
|
15 |
-
log_filename = f'{log_dir}/app_log_{current_time}.txt'
|
16 |
-
logging.basicConfig(
|
17 |
-
level=logging.DEBUG,
|
18 |
-
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
19 |
-
filename=log_filename,
|
20 |
-
filemode='w'
|
21 |
-
)
|
22 |
-
console = logging.StreamHandler()
|
23 |
-
console.setLevel(logging.INFO)
|
24 |
-
formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')
|
25 |
-
console.setFormatter(formatter)
|
26 |
-
logging.getLogger('').addHandler(console)
|
27 |
-
logging.info(f"Logging iniciado. Archivo de log: {log_filename}")
|
28 |
-
|
29 |
-
setup_logging()
|
|
|
30 |
load_dotenv()
|
31 |
|
32 |
st.set_page_config(page_title="AIdeaText", layout="wide", page_icon="random")
|
|
|
7 |
from dotenv import load_dotenv
|
8 |
from datetime import datetime
|
9 |
|
10 |
+
#def setup_logging():
|
11 |
+
# log_dir = 'logs'
|
12 |
+
# if not os.path.exists(log_dir):
|
13 |
+
# os.makedirs(log_dir)
|
14 |
+
# current_time = datetime.now().strftime("%Y%m%d_%H%M%S")
|
15 |
+
# log_filename = f'{log_dir}/app_log_{current_time}.txt'
|
16 |
+
# logging.basicConfig(
|
17 |
+
# level=logging.DEBUG,
|
18 |
+
# format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
19 |
+
# filename=log_filename,
|
20 |
+
# filemode='w'
|
21 |
+
# )
|
22 |
+
# console = logging.StreamHandler()
|
23 |
+
# console.setLevel(logging.INFO)
|
24 |
+
# formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')
|
25 |
+
# console.setFormatter(formatter)
|
26 |
+
# logging.getLogger('').addHandler(console)
|
27 |
+
# logging.info(f"Logging iniciado. Archivo de log: {log_filename}")
|
28 |
+
|
29 |
+
#setup_logging()
|
30 |
+
|
31 |
load_dotenv()
|
32 |
|
33 |
st.set_page_config(page_title="AIdeaText", layout="wide", page_icon="random")
|