summaryrefslogtreecommitdiff
path: root/fs/contrib
diff options
context:
space:
mode:
authorrfkelly0 <rfkelly0@67cdc799-7952-0410-af00-57a81ceafa0f>2011-01-31 04:35:12 +0000
committerrfkelly0 <rfkelly0@67cdc799-7952-0410-af00-57a81ceafa0f>2011-01-31 04:35:12 +0000
commitdfad0e98e861aa3dfff26402b049f13bd2516c87 (patch)
tree80564f6af003af8613ca60cbd188f60344929ef6 /fs/contrib
parent34b32a1ebba22b315101b6a719c8b2e9eb77dc88 (diff)
downloadpyfilesystem-dfad0e98e861aa3dfff26402b049f13bd2516c87.tar.gz
allow uniform use of logging throughout the module
git-svn-id: http://pyfilesystem.googlecode.com/svn/trunk@624 67cdc799-7952-0410-af00-57a81ceafa0f
Diffstat (limited to 'fs/contrib')
-rw-r--r--fs/contrib/davfs/__init__.py10
-rw-r--r--fs/contrib/tahoefs/__init__.py3
2 files changed, 7 insertions, 6 deletions
diff --git a/fs/contrib/davfs/__init__.py b/fs/contrib/davfs/__init__.py
index 475511c..f9239b7 100644
--- a/fs/contrib/davfs/__init__.py
+++ b/fs/contrib/davfs/__init__.py
@@ -31,6 +31,7 @@ import cookielib
import fnmatch
import xml.dom.pulldom
+import fs
from fs.base import *
from fs.path import *
from fs.errors import *
@@ -40,8 +41,7 @@ from fs.contrib.davfs.util import *
from fs.contrib.davfs import xmlobj
from fs.contrib.davfs.xmlobj import *
-import logging
-logger = logging.getLogger("fs.contrib.davfs")
+logger = fs.getLogger("fs.contrib.davfs")
import errno
_RETRYABLE_ERRORS = [errno.EADDRINUSE]
@@ -236,7 +236,7 @@ class DAVFS(FS):
except KeyError:
msg = "unsupported protocol: '%s'" % (url.scheme,)
raise RemoteConnectionError(msg=msg)
- #logger.debug("DAVFS >REQ %s %s/%s",method,url.hostname,url.path)
+ logger.debug("DAVFS >REQ %s %s/%s",method,url.hostname,url.path)
con = ConClass(url.hostname,url.port,timeout=self.timeout)
self._add_connection(con)
try:
@@ -257,11 +257,11 @@ class DAVFS(FS):
resp = con.getresponse()
self._cookiejar.extract_cookies(FakeResp(resp),FakeReq(con,url.scheme,url.path))
except Exception, e:
- #logger.exception("DAVFS <ERR %s %s/%s",method,url.hostname,url.path)
+ logger.exception("DAVFS <ERR %s %s/%s",method,url.hostname,url.path)
self._del_connection(con)
raise
else:
- #logger.debug("DAVFS <RESP %s %s %s/%s",resp.status,method,url.hostname,url.path)
+ logger.debug("DAVFS <RESP %s %s %s/%s",resp.status,method,url.hostname,url.path)
old_close = resp.close
def new_close():
old_close()
diff --git a/fs/contrib/tahoefs/__init__.py b/fs/contrib/tahoefs/__init__.py
index 7dc6a8c..4fde42f 100644
--- a/fs/contrib/tahoefs/__init__.py
+++ b/fs/contrib/tahoefs/__init__.py
@@ -54,6 +54,7 @@ import stat as statinfo
import logging
from logging import DEBUG, INFO, ERROR, CRITICAL
+import fs
import fs.errors as errors
from fs.path import abspath, relpath, normpath, dirname, pathjoin
from fs import FS, NullFile, _thread_synchronize_default, SEEK_END
@@ -63,7 +64,7 @@ from fs.base import fnmatch, NoDefaultMeta
from util import TahoeUtil
from connection import Connection
-logger = logging.getLogger('fs.tahoefs')
+logger = fs.getLogger('fs.tahoefs')
def _fix_path(func):
"""Method decorator for automatically normalising paths."""