Clarify stepper motion during additional surface location attempts.
[pyafm.git] / pyafm.py
index 1d359de81289516f880321268a17252749f7fee0..b78284f2f943ee78c00e845915571798140dd354 100644 (file)
--- a/pyafm.py
+++ b/pyafm.py
@@ -23,7 +23,6 @@ LOG = _logging.getLogger('pyafm')
 
 LOG.setLevel(_logging.DEBUG)
 h = _logging.StreamHandler()
-h.setLevel(_logging.WARN)
 f = _logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
 h.setFormatter(f)
 LOG.addHandler(h)
@@ -161,10 +160,11 @@ class AFM (object):
             cd = self.piezo.read_deflection()
 
         for i in range(2*max(1, self.stepper.backlash)):
-            LOG.debug('additional surface location attempt')
+            LOG.debug(
+                'additional surface location attempt (stepping backwards)')
             try:
                 pos = self.piezo.get_surface_position(
-                    axis_name=self.axis_name, max_deflection=target_def)
+                    axis_name=self.axis_name, max_deflection=target_deflection)
                 return pos
             except _SurfaceError, e:
                 LOG.info(e)