Permalink
Browse files

Adjust logging format to log date/time and seperate values by pipe char

  • Loading branch information...
simoncadman committed Feb 20, 2014
1 parent ed1c9d2 commit 38377432009f1c10f203a143652f3875edb592e4
Showing with 15 additions and 12 deletions.
  1. +1 −1 backend.py
  2. +7 −4 ccputils.py
  3. +1 −1 deleteaccount.py
  4. +1 −1 dynamicppd.py
  5. +1 −1 listcloudprinters.py
  6. +1 −1 listdrivefiles.py
  7. +1 −1 reportissues.py
  8. +1 −1 setupcloudprint.py
  9. +1 −1 upgrade.py
View
@@ -22,7 +22,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140220 211656"
+ CCPVersion = "20140220 214458"
print "CUPS Cloud Print CUPS Backend Version " + CCPVersion
sys.exit(0)
View
@@ -21,15 +21,18 @@ class Utils:
logpath = '/var/log/cups/cloudprint_log'
def SetupLogging(logpath=None):
+ returnValue = True
+ logformat = "%(asctime)s|%(levelname)s|%(message)s"
+ dateformat = "%Y-%m-%d %H:%M:%S"
if logpath == None:
logpath = Utils.logpath
try:
- logging.basicConfig(filename=logpath,level=logging.INFO)
+ logging.basicConfig(filename=logpath,level=logging.INFO,format=logformat,datefmt=dateformat)
except:
- logging.basicConfig(level=logging.INFO)
+ logging.basicConfig(level=logging.INFO,format=logformat,datefmt=dateformat)
logging.error("Unable to write to log file "+ logpath)
- return False
- return True
+ returnValue = False
+ return returnValue
SetupLogging = staticmethod(SetupLogging)
View
@@ -22,7 +22,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140220 211656"
+ CCPVersion = "20140220 214458"
print "CUPS Cloud Print Delete Account Script Version " + CCPVersion
sys.exit(0)
View
@@ -20,7 +20,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140220 211656"
+ CCPVersion = "20140220 214458"
print "CUPS Cloud Print Dynamic PPD Generator Version " + CCPVersion
sys.exit(0)
View
@@ -26,7 +26,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140220 211656"
+ CCPVersion = "20140220 214458"
print "CUPS Cloud Print Printer Lister Version " + CCPVersion
sys.exit(0)
View
@@ -22,7 +22,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140220 211656"
+ CCPVersion = "20140220 214458"
print "CUPS Cloud Print Printer Drive Lister Version " + CCPVersion
sys.exit(0)
View
@@ -21,7 +21,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140220 211656"
+ CCPVersion = "20140220 214458"
print "CUPS Cloud Print Issue Reporting Script Version " + CCPVersion
sys.exit(0)
View
@@ -22,7 +22,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140220 211656"
+ CCPVersion = "20140220 214458"
print "CUPS Cloud Print Setup Script Version " + CCPVersion
sys.exit(0)
View
@@ -33,7 +33,7 @@
logging.warning("Failed to change ownerships and permissions of logfile")
# line below is replaced on commit
- CCPVersion = "20140220 211656"
+ CCPVersion = "20140220 214458"
if len(sys.argv) == 2 and sys.argv[1] == 'version':
print "CUPS Cloud Print Upgrade Script Version " + CCPVersion

0 comments on commit 3837743

Please sign in to comment.