Index: trunk/src/python/unifiedlogger/cad_watcher.py
===================================================================
--- trunk/src/python/unifiedlogger/cad_watcher.py	(revision 522)
+++ trunk/src/python/unifiedlogger/cad_watcher.py	(revision 687)
@@ -11,15 +11,18 @@
 
 lastLineNum = 0
+configdir = "config"  # default dir for production
 
-def setup():
+def setup(dir):
+    global lastLineNum, configdir
     lastLineNum = 0
+    configdir = dir
     return
 
 # Retrieve new messages from CAD comment log 
 def getLogEntries():
-    global lastLineNum
+    global lastLineNum, configdir
     # get path to input file from configuration
     config = ConfigParser.ConfigParser()
-    config.read('config/logging_service.cfg')
+    config.read(configdir+'/logging_service.cfg')
     logfilepath  = config.get('Paths', 'UnifiedLogPath')
     pathToLog = logfilepath + "CADcomments.log"
@@ -29,7 +32,8 @@
     except IOError as ex:
         if ex.errno == 2:
-            # 'No such file or directory
-            print pathToLog + " missing: assuming reset."
-            lastLineNum = 0   #Start over
+            # 'No such file or directory'
+            # Assume this is a read sync problem: Don't modify lastLineNum
+            print pathToLog + " missing, skipping file read."
+            #lastLineNum = 0   #Start over
             return []
         else:
@@ -41,19 +45,18 @@
         fileSize = os.path.getsize(pathToLog)
         if fileSize == 0:
-            # Assume this is a read sync problem: Don't modify lastLineNum
-            print pathToLog+" is empty, ignoring."
+            print pathToLog+" is empty, skipping file read and resetting."
             lastLineNum = 0   #Start over
             return []
         else: # file is good, read it.
-            msgList = text_file.read().split('\n')
+            msgList = text_file.read().strip().split('\n')
             text_file.close()
             currList = []
             currList = msgList[lastLineNum:] # new items since last file read
-            lastLineNum = len(msgList)-1
+            lastLineNum = len(msgList)
             return currList
 
 # Local main for unit testing
 def main():
-    setup()
+    setup("config/devlinux")
     # Loop Forever, checking every five seconds
     while True:
