Skip to content

Commit c62f469

Browse files
committed
logs
save log files to logs dir, fixed log datetime
1 parent 32f976c commit c62f469

File tree

10 files changed

+17
-13
lines changed

10 files changed

+17
-13
lines changed

geolocation/IpGeoLocation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55
IPGeoLocation - Retrieve IP Geolocation information
66
Powered by http://ip-api.com
7-
Copyright (C) 2015 @maldevel
7+
Copyright (C) 2015-2016 @maldevel
88
99
This program is free software: you can redistribute it and/or modify
1010
it under the terms of the GNU General Public License as published by

geolocation/IpGeoLocationLib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55
IPGeoLocation - Retrieve IP Geolocation information
66
Powered by http://ip-api.com
7-
Copyright (C) 2015 @maldevel
7+
Copyright (C) 2015-2016 @maldevel
88
99
This program is free software: you can redistribute it and/or modify
1010
it under the terms of the GNU General Public License as published by

geolocation/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
IPGeoLocation - Retrieve IP Geolocation information
33
Powered by http://ip-api.com
4-
Copyright (C) 2015 @maldevel
4+
Copyright (C) 2015-2016 @maldevel
55
66
This program is free software: you can redistribute it and/or modify
77
it under the terms of the GNU General Public License as published by

ip2geolocation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55
IPGeoLocation - Retrieve IP Geolocation information
66
Powered by http://ip-api.com
7-
Copyright (C) 2015 @maldevel
7+
Copyright (C) 2015-2016 @maldevel
88
99
This program is free software: you can redistribute it and/or modify
1010
it under the terms of the GNU General Public License as published by

libraries/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
IPGeoLocation - Retrieve IP Geolocation information
33
Powered by http://ip-api.com
4-
Copyright (C) 2015 @maldevel
4+
Copyright (C) 2015-2016 @maldevel
55
66
This program is free software: you can redistribute it and/or modify
77
it under the terms of the GNU General Public License as published by

logs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

utilities/FileExporter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55
IPGeoLocation - Retrieve IP Geolocation information
66
Powered by http://ip-api.com
7-
Copyright (C) 2015 @maldevel
7+
Copyright (C) 2015-2016 @maldevel
88
99
This program is free software: you can redistribute it and/or modify
1010
it under the terms of the GNU General Public License as published by

utilities/Logger.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55
IPGeoLocation - Retrieve IP Geolocation information
66
Powered by http://ip-api.com
7-
Copyright (C) 2015 @maldevel
7+
Copyright (C) 2015-2016 @maldevel
88
99
This program is free software: you can redistribute it and/or modify
1010
it under the terms of the GNU General Public License as published by
@@ -22,13 +22,15 @@
2222

2323
__author__ = 'maldevel'
2424

25-
from time import gmtime, strftime
25+
from datetime import datetime
26+
import os
2627

2728
class Logger:
2829

2930
@staticmethod
3031
def WriteLog(messagetype, message):
31-
filename = '{}.log'.format(strftime("%Y%m%d", gmtime()))
32-
with open(filename, 'a') as logFile:
33-
logFile.write('[{}] {} - {}\n'.format(messagetype, strftime("%Y-%m-%d %H:%M:%S", gmtime()), message))
32+
filename = '{}.log'.format(datetime.strftime(datetime.now(), "%Y%m%d"))
33+
path = os.path.join('.', 'logs', filename)
34+
with open(path, 'a') as logFile:
35+
logFile.write('[{}] {} - {}\n'.format(messagetype, datetime.strftime(datetime.now(), "%Y-%m-%d %H:%M:%S"), message))
3436

utilities/MyExceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55
IPGeoLocation - Retrieve IP Geolocation information
66
Powered by http://ip-api.com
7-
Copyright (C) 2015 @maldevel
7+
Copyright (C) 2015-2016 @maldevel
88
99
This program is free software: you can redistribute it and/or modify
1010
it under the terms of the GNU General Public License as published by

utilities/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
IPGeoLocation - Retrieve IP Geolocation information
33
Powered by http://ip-api.com
4-
Copyright (C) 2015 @maldevel
4+
Copyright (C) 2015-2016 @maldevel
55
66
This program is free software: you can redistribute it and/or modify
77
it under the terms of the GNU General Public License as published by

0 commit comments

Comments
 (0)