File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 1
1
/relatorios
2
- app /__pycache__
2
+ app /__pycache__
3
+ app /logs
Original file line number Diff line number Diff line change 3
3
# Inicialização do aplicativo Flask
4
4
app = Flask (__name__ )
5
5
6
+ # Configuração básica do logger
7
+ import logging
8
+ import os
9
+
10
+ LOG_DIR = os .path .join (os .path .abspath (os .path .dirname (__file__ )), 'logs' )
11
+ LOG_FILE = os .path .join (LOG_DIR , 'app.log' )
12
+ #LOG_FILE_DEBUG = os.path.join(LOG_DIR, 'debug.log')
13
+
14
+
15
+ if not os .path .exists (LOG_DIR ):
16
+ os .makedirs (LOG_DIR )
17
+
18
+ logging .basicConfig (filename = LOG_FILE , level = logging .INFO )
19
+ #logging.basicConfig(filename=LOG_FILE_DEBUG, level=logging.DEBUG)
20
+
6
21
# Importação de rotas para registrar rotas
7
22
from app import routes
Original file line number Diff line number Diff line change 7
7
8
8
@app .route ('/' )
9
9
def index ():
10
+ app .logger .info ('Acesso à página inicial' )
10
11
return render_template ('index.html' )
11
12
12
13
@app .route ('/login' )
You can’t perform that action at this time.
0 commit comments