Index: /inundation/ga/storm_surge/pyvolution/cg_solve.py
===================================================================
--- /inundation/ga/storm_surge/pyvolution/cg_solve.py	(revision 1149)
+++ /inundation/ga/storm_surge/pyvolution/cg_solve.py	(revision 1150)
@@ -1,4 +1,14 @@
 import exceptions
 class VectorShapeError(exceptions.Exception): pass
+
+import logging, logging.config
+logger = logging.getLogger('cg_solve')
+
+logging.config.fileConfig('log.ini')
+
+#logger.setLevel(logging.DEBUG)
+
+
+
 
 
@@ -7,5 +17,5 @@
    Try to solve linear equation Ax = b using
    conjugate gradient method
-   
+
    Input
    A: matrix or function which applies a matrix, assumed symmetric
@@ -15,5 +25,5 @@
    imax: max number of iterations
    tol: tolerance used for residual
-   
+
    Output
    x: approximate solution
@@ -21,5 +31,5 @@
 
    from Numeric import dot, array, Float, zeros
-   
+
    b  = array(b, typecode=Float)
    if len(b.shape) != 1 :
@@ -28,12 +38,12 @@
    if x0 is None:
       x0 = zeros(b.shape, typecode=Float)
-   else:   
+   else:
       x0 = array(x0, typecode=Float)
-      
+
 
    #FIXME: Should test using None
    if iprint == 0:
       iprint = imax
-      
+
    i=1
    x = x0
@@ -58,13 +68,9 @@
        i = i+1
        if i%iprint == 0 :
-          pass
-          #FIXME: Should depend on verbosity 
-          #print 'i = %g rTr = %20.15e'% (i,rTr)
+          logger.info('i = %g rTr = %20.15e'% (i,rTr))
 
-   #FIXME: Should this raise an exception?       
+   #FIXME: Should this raise an exception?
    if i==imax:
      print 'max number of iterations attained'
 
    return x
-
-
Index: /inundation/ga/storm_surge/pyvolution/log.ini
===================================================================
--- /inundation/ga/storm_surge/pyvolution/log.ini	(revision 1150)
+++ /inundation/ga/storm_surge/pyvolution/log.ini	(revision 1150)
@@ -0,0 +1,42 @@
+
+[loggers]
+keys=root,cg_solve,least_squares
+
+[handlers]
+keys=hand01
+
+[formatters]
+keys=form01
+
+#-----------------------------------------------------------------------
+[logger_root]
+level=NOTSET
+handlers=hand01
+
+[logger_cg_solve]
+level=ERROR
+handlers=hand01
+propagate=0
+qualname=cg_solve
+
+[logger_least_squares]
+level=INFO
+handlers=hand01
+propagate=0
+qualname=least_squares
+
+#-----------------------------------------------------------------------
+# Handlers
+[handler_hand01]
+class=StreamHandler
+level=NOTSET
+formatter=form01
+args=(sys.stdout,)
+
+
+#-----------------------------------------------------------------------
+# Formats
+[formatter_form01]
+format=%(name)s %(levelname)s %(message)s
+datefmt=
+
Index: /inundation/ga/storm_surge/pyvolution/pyvolution.ini
===================================================================
--- /inundation/ga/storm_surge/pyvolution/pyvolution.ini	(revision 1149)
+++ /inundation/ga/storm_surge/pyvolution/pyvolution.ini	(revision 1150)
@@ -1,4 +1,5 @@
 [Files MRU]
-0=c:\home\projects\python-fvm\pyvolution\cg_solve.py.html
-1=c:\home\projects\python-fvm\pyvolution\pyvolution.zpi
-2=c:\program files\zfw\readme.txt
+0=c:\home\projects\python-fvm\pyvolution\least_squares.py
+1=c:\home\projects\python-fvm\pyvolution\cg_solve.py.html
+2=c:\home\projects\python-fvm\pyvolution\pyvolution.zpi
+3=c:\program files\zfw\readme.txt
Index: /inundation/ga/storm_surge/pyvolution/test_advection.py
===================================================================
--- /inundation/ga/storm_surge/pyvolution/test_advection.py	(revision 1149)
+++ /inundation/ga/storm_surge/pyvolution/test_advection.py	(revision 1150)
@@ -133,9 +133,9 @@
 
         #Populate boundary array with dirichlet conditions.
- 	domain.neighbours = array([[1,-1,-2], [0,-3,-4]])
+        domain.neighbours = array([[1,-1,-2], [0,-3,-4]])
         domain.set_quantity('stage', [1.0, 0.0], 'centroids')
-	domain.distribute_to_vertices_and_edges()
+        domain.distribute_to_vertices_and_edges()
 
-	domain.compute_fluxes()
+        domain.compute_fluxes()
 
         X = domain.quantities['stage'].explicit_update
