Skip to content

Commit 768c779

Browse files
update the logging system.
1 parent 408de02 commit 768c779

3 files changed

Lines changed: 21 additions & 23 deletions

File tree

app.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# from app import create_app
2-
# from app.config import Config
1+
from app import create_app
2+
from app.config import Config
33

4-
# app = create_app(Config)
4+
app = create_app(Config)
55

6-
# if __name__ == "__main__":
7-
# app.run(debug=app.config["DEBUG"])
6+
if __name__ == "__main__":
7+
app.run(debug=app.config["DEBUG"])

app/__init__.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,16 @@ def create_app(config_class=Config):
3838
#loggin setup
3939
formatter = logging.Formatter("%(asctime)s | %(levelname)s | %(message)s")
4040

41-
if not app.logger.handlers:
42-
if not app.config.get("TESTING"):
43-
log_dir = os.path.dirname(app.config["LOG_FILE"])
44-
if log_dir :
45-
os.makedirs(log_dir,exist_ok=True)
46-
handler = RotatingFileHandler(app.config.get("LOG_FILE","banking_core.log"),maxBytes=10240,backupCount=5)
47-
else :
48-
handler = logging.StreamHandler()
49-
50-
handler.setFormatter(formatter)
51-
app.logger.addHandler(handler)
52-
app.logger.setLevel(app.config["LOG_LEVEL"])
41+
if not app.config.get("TESTING"):
42+
log_dir = os.path.dirname(app.config["LOG_FILE"])
43+
if log_dir :
44+
os.makedirs(log_dir,exist_ok=True)
45+
handler = RotatingFileHandler(app.config.get("LOG_FILE","banking_core.log"),maxBytes=10240,backupCount=5)
46+
else :
47+
handler = logging.StreamHandler()
48+
handler.setFormatter(formatter)
49+
app.logger.addHandler(handler)
50+
app.logger.setLevel(app.config["LOG_LEVEL"])
5351

5452
csp={
5553
"default-src":["'self'"],

app/static/js/service_requests.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ case "CHANGE_PIN":
149149
<label class="absolute left-5 top-2.5 text-gray-500 dark:text-gray-400 text-xs font-semibold uppercase tracking-wider transition-all peer-placeholder-shown:top-4 peer-placeholder-shown:text-sm peer-placeholder-shown:normal-case peer-placeholder-shown:tracking-normal peer-focus:top-2.5 peer-focus:text-xs peer-focus:uppercase peer-focus:tracking-wider peer-focus:text-cyan-500">New PIN</label>
150150
<button type="button" id="toggleIcon" onclick="togglePin()" class="absolute right-5 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 text-xl">👁️</button>
151151
`;
152-
button.addEventListener(onclick,submitRequest('CHANGE_PIN'));
152+
button.addEventListener("click",()=>submitRequest("CHANGE_PIN"));
153153

154154
break;
155155

@@ -158,8 +158,8 @@ case "CHANGE_ACCOUNT_NAME":
158158
<input type="text" id="new_name" class="peer w-full bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-white border border-gray-300 dark:border-gray-600 rounded-2xl px-5 pt-7 pb-3 focus:ring-2 focus:ring-cyan-500 focus:border-transparent outline-none transition-all font-medium">
159159
<label class="absolute left-5 top-2.5 text-gray-500 dark:text-gray-400 text-xs font-semibold uppercase tracking-wider transition-all peer-placeholder-shown:top-4 peer-placeholder-shown:text-sm peer-placeholder-shown:normal-case peer-placeholder-shown:tracking-normal peer-focus:top-2.5 peer-focus:text-xs peer-focus:uppercase peer-focus:tracking-wider peer-focus:text-cyan-500">New Account Name</label>
160160
`;
161-
button.addEventListener(onclick,submitRequest('CHANGE_ACCOUNT_NAME'));
162-
161+
button.addEventListener("click",()=>submitRequest("CHANGE_ACCOUNT_NAME"));
162+
163163
break;
164164

165165
//NOTE : //h future request query implementation :
@@ -224,9 +224,9 @@ case "CHANGE_ACCOUNT_NAME":
224224
}
225225

226226
async function submitRequest(query_type){
227-
// document.getElementById("dynamic_submit_button").disabled = true;
228-
// document.getElementById("btnText").textContent = "Logging in...";
229-
// document.getElementById("spinner").classList.remove("hidden");
227+
document.getElementById("dynamic_submit_button").disabled = true;
228+
document.getElementById("btnText").textContent = "Logging in...";
229+
document.getElementById("spinner").classList.remove("hidden");
230230
const fields = document.querySelectorAll("#dynamic_form_fields input, #dynamic_form_fields textarea");
231231

232232
const payload = {};

0 commit comments

Comments
 (0)