Permalink
Browse files

Start logging in all runnable scripts

  • Loading branch information...
simoncadman committed Jan 26, 2014
1 parent 0defe93 commit 558811dd6a292e43b6c5e224718258cb732997fe
Showing with 49 additions and 14 deletions.
  1. +1 −1 backend.py
  2. +9 −2 deleteaccount.py
  3. +9 −2 dynamicppd.py
  4. +1 −1 listcloudprinters.py
  5. +9 −2 listdrivefiles.py
  6. +9 −2 reportissues.py
  7. +9 −2 setupcloudprint.py
  8. +1 −1 submitjob.py
  9. +1 −1 upgrade.py
View
@@ -20,7 +20,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 215144"
+ CCPVersion = "20140126 215658"
print "CUPS Cloud Print CUPS Backend Version " + CCPVersion
sys.exit(0)
View
@@ -15,16 +15,23 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import cups, os, json, sys
+import cups, os, json, sys, logging
from auth import Auth
from printer import Printer
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 215144"
+ CCPVersion = "20140126 215658"
print "CUPS Cloud Print Delete Account Script Version " + CCPVersion
sys.exit(0)
+logpath = '/var/log/cups/cloudprint_log'
+try:
+ logging.basicConfig(filename=logpath,level=logging.INFO)
+except:
+ logging.basicConfig(level=logging.INFO)
+ logging.error("Unable to write to log file "+ logpath)
+
while True:
result = Auth.SetupAuth(False)
if not result:
View
@@ -15,14 +15,21 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import sys, os, locale
+import sys, os, locale, logging
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 215144"
+ CCPVersion = "20140126 215658"
print "CUPS Cloud Print Dynamic PPD Generator Version " + CCPVersion
sys.exit(0)
+logpath = '/var/log/cups/cloudprint_log'
+try:
+ logging.basicConfig(filename=logpath,level=logging.INFO)
+except:
+ logging.basicConfig(level=logging.INFO)
+ logging.error("Unable to write to log file "+ logpath)
+
libpath = "/usr/local/share/cloudprint-cups/"
if not os.path.exists( libpath ):
libpath = "/usr/share/cloudprint-cups"
View
@@ -28,7 +28,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 215144"
+ CCPVersion = "20140126 215658"
print "CUPS Cloud Print Printer Lister Version " + CCPVersion
sys.exit(0)
View
@@ -15,16 +15,23 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import sys
+import sys, logging
from auth import Auth
from printer import Printer
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 215144"
+ CCPVersion = "20140126 215658"
print "CUPS Cloud Print Printer Drive Lister Version " + CCPVersion
sys.exit(0)
+logpath = '/var/log/cups/cloudprint_log'
+try:
+ logging.basicConfig(filename=logpath,level=logging.INFO)
+except:
+ logging.basicConfig(level=logging.INFO)
+ logging.error("Unable to write to log file "+ logpath)
+
requestors, storage = Auth.SetupAuth(True, permissions=['https://www.googleapis.com/auth/cloudprint', 'https://www.googleapis.com/auth/drive.readonly'])
printer = Printer(requestors)
files = printer.getDriveFiles()
View
@@ -15,14 +15,21 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import sys, os, subprocess
+import sys, os, subprocess, logging
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 215144"
+ CCPVersion = "20140126 215658"
print "CUPS Cloud Print Issue Reporting Script Version " + CCPVersion
sys.exit(0)
+logpath = '/var/log/cups/cloudprint_log'
+try:
+ logging.basicConfig(filename=logpath,level=logging.INFO)
+except:
+ logging.basicConfig(level=logging.INFO)
+ logging.error("Unable to write to log file "+ logpath)
+
libpath = "/usr/local/share/cloudprint-cups/"
if not os.path.exists( libpath ):
libpath = "/usr/share/cloudprint-cups"
View
@@ -15,16 +15,23 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import cups, os, json, sys
+import cups, os, json, sys, logging
from auth import Auth
from printer import Printer
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 215144"
+ CCPVersion = "20140126 215658"
print "CUPS Cloud Print Setup Script Version " + CCPVersion
sys.exit(0)
+logpath = '/var/log/cups/cloudprint_log'
+try:
+ logging.basicConfig(filename=logpath,level=logging.INFO)
+except:
+ logging.basicConfig(level=logging.INFO)
+ logging.error("Unable to write to log file "+ logpath)
+
unattended = False
answer = ""
View
@@ -29,7 +29,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 215144"
+ CCPVersion = "20140126 215658"
print "CUPS Cloud Print Submit Job Version " + CCPVersion
sys.exit(0)
View
@@ -41,7 +41,7 @@
sys.stderr.write("If you are upgrading from version 20131013 or earlier you should be aware that the scripts have moved from /usr/lib/cloudprint-cups to /usr/share/cloudprint-cups\n")
# line below is replaced on commit
-CCPVersion = "20140126 215144"
+CCPVersion = "20140126 215658"
if len(sys.argv) == 2 and sys.argv[1] == 'version':
print "CUPS Cloud Print Upgrade Script Version " + CCPVersion

0 comments on commit 558811d

Please sign in to comment.