Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Krish Moodbidri
self-reg-form
Commits
9b66e0dc
Commit
9b66e0dc
authored
Dec 18, 2019
by
Mitchell Moore
Browse files
add timestamps to server logs
parent
4c044deb
Changes
1
Hide whitespace changes
Inline
Side-by-side
run.py
View file @
9b66e0dc
...
...
@@ -40,12 +40,12 @@ def check_dir(user, interval):
@
socketio
.
on
(
'user connect'
)
def
handle_my_custom_event
(
json
,
methods
=
[
'GET'
,
'POST'
]):
username
=
json
[
"user"
]
print
(
'
User '
+
username
+
' connected.'
)
print
(
time
.
strftime
(
"%m-%d-%Y_%H:%M:%S"
)
+
'
\t
User '
+
username
+
' connected.'
)
@
socketio
.
on
(
'user data'
)
def
ingest_data
(
json
,
methods
=
[
'GET'
,
'POST'
]):
print
(
'
Queue request received: '
,
str
(
json
))
print
(
time
.
strftime
(
"%m-%d-%Y_%H:%M:%S"
)
+
'
\t
Queue request received: '
+
str
(
json
))
try
:
fullname
=
json
[
"fullname"
]
...
...
@@ -65,11 +65,11 @@ def ingest_data(json, methods=['GET', 'POST']):
file
.
write
(
reason
)
file
.
close
()
print
(
'
User '
+
username
+
' added to queue'
)
print
(
time
.
strftime
(
"%m-%d-%Y_%H:%M:%S"
)
+
'
\t
User '
+
username
+
' added to queue'
)
socketio
.
emit
(
"creating account"
)
except
Exception
as
e
:
print
(
"
Error in directory creation: "
,
e
)
print
(
time
.
strftime
(
"%m-%d-%Y_%H:%M:%S"
)
+
"
\t
Error in directory creation: "
,
e
)
socketio
.
emit
(
"Account creation failed"
)
...
...
@@ -78,7 +78,7 @@ def creation_confirmation(json, methods=['GET', 'POST']):
username
=
json
[
"username"
]
if
check_dir
(
username
,
10
):
print
(
'
Account successfully created for '
+
username
)
print
(
time
.
strftime
(
"%m-%d-%Y_%H:%M:%S"
)
+
'
\t
Account successfully created for '
+
username
)
socketio
.
emit
(
"Account created"
)
else
:
socketio
.
emit
(
"Account creation failed"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment