]> git.ipfire.org Git - ipfire.org.git/commitdiff
Converted debug log to error log.
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 3 Nov 2008 21:25:23 +0000 (22:25 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 3 Nov 2008 21:25:23 +0000 (22:25 +0100)
download/getfile.py

index eb57b56dc7900056f73373eca425701076209c83..c503e71b0025b4593a253c4a9e4dcece9dbba75f 100644 (file)
@@ -7,8 +7,8 @@ import urlparse
 import cgi
 from mimetypes import guess_type
 
-debug = open("debug.log", "a") #None
 access = open("access.log", "a")
+error  = open("error.log",  "a")
 
 hosts = (
 #                      PRIO SCHEME  HOSTNAME               PATH
@@ -63,8 +63,8 @@ class Server:
                try:
                        f = urllib2.urlopen("%s" % urlparse.urljoin(self.url(), file))
                except (urllib2.HTTPError, urllib2.URLError), e:
-                       if debug:
-                               debug.write("ERR %s %s\n" % (self.url(), e))
+                       if error:
+                               error.write("ERR 500 - %s %s\n" % (self.url(), e))
                else:
                        ret = f.geturl()
                        f.close()
@@ -127,8 +127,6 @@ while servers.all():
        print
 
        access.write("%s\n" % url)
-       if debug:
-               debug.write("OK  %s\n" % url)
 
        break
 else:
@@ -140,9 +138,9 @@ else:
                print "Pragma: no-cache"
                print
 
-               if debug:
-                       debug.write("ERR %s wasn't found on any server" % file)
+               if error:
+                       error.write("ERR 404 - %s wasn't found on any server" % file)
 
 access.close()
-if debug:
-       debug.close()
+if error:
+       error.close()