-
Notifications
You must be signed in to change notification settings - Fork 0
/
mylog.py
45 lines (33 loc) · 957 Bytes
/
mylog.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/python3.4
# creating my own logging as the built in stuff seems overley complicated
# this is all thats need to get it to run
#
'''
#!/usr/bin/python3.4
import mylog
text="i have worked"
v123=1
mylog.fmlog(detail=text, verbosity=v123)
mylog.fmlog(detail=str(("GoalKeeper Score ", gk)), verbosity=1)
'''
import inspect
def fmlog(detail,verbosity):
#variables
import os
import sys
frame_records = inspect.stack()[1]
b=calling_module = inspect.getmodulename(frame_records[1])
from datetime import datetime
file = open("log.txt","a")
n = datetime.now()
###writing
file.write(str(n))
file.write (" -")
file.write(detail)
file.write (" -")
file.write (b)
file.write (" -")
file.write (" verbosity ")
file.write (str(verbosity))
file.write("\n")
file.close()