commit 485b83a1c97d6abb94cf40fea26b054a7b818a83
Author: Christian Egli <christian.egli@sbs.ch>
Date:   Tue Mar 5 16:56:51 2019 +0100

    Use the prefixed LOG_FOO constants
    
    i.e. change LOG_FOO to LOU_LOG_FOO

diff --git a/java/Jliblouisutdml.c b/java/Jliblouisutdml.c
index bd03c6c..cae00ec 100644
--- a/java/Jliblouisutdml.c
+++ b/java/Jliblouisutdml.c
@@ -243,11 +243,11 @@ Java_org_liblouis_LibLouisUTDML_backTranslateString (JNIEnv * env,
   if (inbufX == NULL)
     goto release;
   inlen = (*env)->GetArrayLength (env, inbuf);
-  logMessage(LOG_DEBUG, "inlen=%d", inlen);
+  logMessage(LOU_LOG_DEBUG, "inlen=%d", inlen);
   if (outbuf == NULL)
     goto release;
   (*env)->GetIntArrayRegion (env, outlen, 0, 1, &outlenX);
-  logMessage(LOG_DEBUG, "outlenX=%d", outlenX);
+  logMessage(LOU_LOG_DEBUG, "outlenX=%d", outlenX);
   if (outlenX == EMPTY)
     goto release;
   if (logFile != NULL)
@@ -269,17 +269,17 @@ Java_org_liblouis_LibLouisUTDML_backTranslateString (JNIEnv * env,
     {
       int wcLength;
       int utf8Length;
-      logMessage(LOG_DEBUG, "After backTranslate outlenX=%d", outlenX);
+      logMessage(LOU_LOG_DEBUG, "After backTranslate outlenX=%d", outlenX);
       if (ud->format_for == utd)
 	{
-          logMessage(LOG_DEBUG, "Preparing to return UTD");
+          logMessage(LOU_LOG_DEBUG, "Preparing to return UTD");
 	  (*env)->SetByteArrayRegion (env, outbuf, 0, outlenX,
 				      (jbyte *) outbufX);
 	  utf8Length = outlenX;
 	}
       else
 	{
-          logMessage(LOG_DEBUG, "Preparing to return non-UTD");
+          logMessage(LOU_LOG_DEBUG, "Preparing to return non-UTD");
 	  wcLength = outlenX;
 	  utf8Length = outlenX;
           outbufY = (jbyte *)malloc(utf8Length);
@@ -876,7 +876,7 @@ JNIEXPORT jboolean JNICALL Java_org_liblouis_LibLouisUTDML_file2brl
 		  k++;
 		  break;
 		default:
-		  logMessage (LOG_ERROR, "invalid argument '%s'", curArg);
+		  logMessage (LOU_LOG_ERROR, "invalid argument '%s'", curArg);
 		  return JNI_FALSE;
 		}
 	      continue;
@@ -896,7 +896,7 @@ JNIEXPORT jboolean JNICALL Java_org_liblouis_LibLouisUTDML_file2brl
 		}
 	      else
 		{
-		  logMessage (LOG_ERROR, "extra operand: '%s'\n",
+		  logMessage (LOU_LOG_ERROR, "extra operand: '%s'\n",
 				getArg (env, obj, args, k + 2));
 		  return JNI_FALSE;
 		}
@@ -923,7 +923,7 @@ configSettings, 0))
     {
       if (!(inputFile = fopen (inputFileName, "rb")))
 	{
-	  logMessage (LOG_ERROR, "Can't open input file '%s'.\n", inputFileName);
+	  logMessage (LOU_LOG_ERROR, "Can't open input file '%s'.\n", inputFileName);
 	  lbu_logEnd ();
 	  return JNI_FALSE;
 	}
@@ -935,7 +935,7 @@ configSettings, 0))
   strcat (tempFileName, "file2brl.temp");
   if (!(tempFile = fopen (tempFileName, "wb")))
     {
-      logMessage (LOG_ERROR, "Can't open temporary file.\n");
+      logMessage (LOU_LOG_ERROR, "Can't open temporary file.\n");
       lbu_logEnd ();
       return JNI_FALSE;
     }
@@ -1053,7 +1053,7 @@ configSettings, 0))
 			   NULL, mode);
 	break;
       default:
-	logMessage (LOG_ERROR, "Program bug %c\n", whichProc);
+	logMessage (LOU_LOG_ERROR, "Program bug %c\n", whichProc);
 	break;
       }
   if (configSettings != NULL)
diff --git a/liblouisutdml/change_table.c b/liblouisutdml/change_table.c
index e40c54a..2af555a 100644
--- a/liblouisutdml/change_table.c
+++ b/liblouisutdml/change_table.c
@@ -46,7 +46,7 @@ change_table (xmlNode * node)
     return 0;
   if (!find_file (newTable, completePath))
     {
-      logMessage (LOG_ERROR, "Table %s cannot be found", newTable);
+      logMessage (LOU_LOG_ERROR, "Table %s cannot be found", newTable);
       return 0;
     }
   if (!lou_getTable (completePath))
diff --git a/liblouisutdml/convert_utd.c b/liblouisutdml/convert_utd.c
index f96e334..69c53f0 100644
--- a/liblouisutdml/convert_utd.c
+++ b/liblouisutdml/convert_utd.c
@@ -57,7 +57,7 @@ convert_utd ()
   int haveSemanticFile;
   if (rootElement == NULL)
     {
-      logMessage (LOG_ERROR, "Document is empty");
+      logMessage (LOU_LOG_ERROR, "Document is empty");
       return 0;
     }
   clean_semantic_table ();
@@ -103,7 +103,7 @@ pass2_conv ()
   xmlNode *child;
   if (rootElement == NULL)
     {
-      logMessage (LOG_ERROR, "Document is empty");
+      logMessage (LOU_LOG_ERROR, "Document is empty");
       return 0;
     }
   clean_semantic_table ();
diff --git a/liblouisutdml/examine_document.c b/liblouisutdml/examine_document.c
index 4d1df61..3073696 100644
--- a/liblouisutdml/examine_document.c
+++ b/liblouisutdml/examine_document.c
@@ -42,7 +42,7 @@ examine_document (xmlNode * node)
 {
 /*Examine the parse tree, add semantic attributes and set indicators.*/
   xmlNode *child;
-  logMessage(LOG_INFO, "Begin examine_document: node->name=%s", node->name);
+  logMessage(LOU_LOG_INFO, "Begin examine_document: node->name=%s", node->name);
   if (node == NULL)
     return 0;
   ud->stack[++ud->top] = set_sem_attr (node);
@@ -114,7 +114,7 @@ static void
 examText (xmlNode * node)
 /*We may want to examine text content in the future*/
 {
-  logMessage(LOG_INFO, "Begin examText: node->content=%s", node->content);
+  logMessage(LOU_LOG_INFO, "Begin examText: node->content=%s", node->content);
   switch (ud->stack[ud->top])
     {
     case pagenum:
@@ -127,7 +127,7 @@ examText (xmlNode * node)
 static void
 examCdataa (xmlNode * node)
 {
-  logMessage(LOG_INFO, "Begin examCdata");
+  logMessage(LOU_LOG_INFO, "Begin examCdata");
   ud->has_cdata = 1;
 }
 
diff --git a/liblouisutdml/liblouisutdml.c b/liblouisutdml/liblouisutdml.c
index 9f99340..6b3ff4c 100644
--- a/liblouisutdml/liblouisutdml.c
+++ b/liblouisutdml/liblouisutdml.c
@@ -63,7 +63,7 @@ libxml_errors (void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
   memset (buffer, 0, sizeof (buffer));
   vsnprintf (buffer, sizeof (buffer) - 4, msg, args);
   va_end (args);
-  logMessage (LOG_ERROR, "%s", buffer);
+  logMessage (LOU_LOG_ERROR, "%s", buffer);
 }
 
 static xmlParserCtxt *ctxt;
@@ -125,7 +125,7 @@ processXmlDocument (const char *inputDoc, int length)
 	  if (ud->doc == NULL)
 	    {
 	      logMessage
-		(LOG_FATAL, "Document could not be processed; may be \
+		(LOU_LOG_FATAL, "Document could not be processed; may be \
 malformed or contain illegal characters");
 	      cleanupLibxml ();
 	      return 0;
@@ -136,20 +136,20 @@ malformed or contain illegal characters");
     ud->doc = xmlParseMemory (inputDoc, length);
   if (ud->doc == NULL)
     {
-      logMessage (LOG_FATAL, "Document could not be processed, probably  malformed");
+      logMessage (LOU_LOG_FATAL, "Document could not be processed, probably  malformed");
       cleanupLibxml ();
       return 0;
     }
   if (ud->doc->encoding == NULL)
     {
-      logMessage (LOG_ERROR, "Encoding, preferably UTF-8,  must be specified");
+      logMessage (LOU_LOG_ERROR, "Encoding, preferably UTF-8,  must be specified");
       cleanupLibxml ();
       return 0;
     }
   if (ud->format_for >= utd && ignore_case_comp (ud->doc->encoding,
 						 "UTF-8", 5) != 0)
     {
-      logMessage (LOG_ERROR, "UTDML requires UTF-8 encoding, not '%s'",
+      logMessage (LOU_LOG_ERROR, "UTDML requires UTF-8 encoding, not '%s'",
 		    ud->doc->encoding);
       cleanupLibxml ();
       return 0;
@@ -157,7 +157,7 @@ malformed or contain illegal characters");
   rootElement = xmlDocGetRootElement (ud->doc);
   if (rootElement == NULL)
     {
-      logMessage (LOG_ERROR, "Document is empty");
+      logMessage (LOU_LOG_ERROR, "Document is empty");
       cleanupLibxml ();
       return 0;
     }
@@ -179,7 +179,7 @@ malformed or contain illegal characters");
 	}
       if (!transcribe_document (rootElement))
 	{
-	  logMessage (LOG_ERROR, "Document could not be transcribed");
+	  logMessage (LOU_LOG_ERROR, "Document could not be transcribed");
 	  cleanupLibxml ();
 	  return 0;
 	}
@@ -240,7 +240,7 @@ lbu_translateString (const char *configFileList,
       inlen += strlen (ud->xml_header);
       if (!(xmlInbuf = malloc (inlen + 4)))
 	{
-	  logMessage (LOG_FATAL, "Not enough memory");
+	  logMessage (LOU_LOG_FATAL, "Not enough memory");
 	  return 0;
 	}
       strcpy (xmlInbuf, ud->xml_header);
@@ -274,7 +274,7 @@ LBUAPI int EXPORT_CALL lbu_translateFile
     {
       if (!(ud->outFile = fopen (outFileName, "wb")))
 	{
-	  logMessage (LOG_ERROR, "Can't open output file %s.", outFileName);
+	  logMessage (LOU_LOG_ERROR, "Can't open output file %s.", outFileName);
 	  return 0;
 	}
     }
@@ -308,7 +308,7 @@ LBUAPI int EXPORT_CALL lbu_translateTextFile
     {
       if (!(ud->inFile = fopen (inFileName, "rb")))
 	{
-	  logMessage (LOG_ERROR, "Can't open input file %s.", inFileName);
+	  logMessage (LOU_LOG_ERROR, "Can't open input file %s.", inFileName);
 	  return 0;
 	}
     }
@@ -318,7 +318,7 @@ LBUAPI int EXPORT_CALL lbu_translateTextFile
     {
       if (!(ud->outFile = fopen (outFileName, "wb")))
 	{
-	  logMessage (LOG_ERROR, "Can't open output file %s.", outFileName);
+	  logMessage (LOU_LOG_ERROR, "Can't open output file %s.", outFileName);
 	  return 0;
 	}
     }
@@ -350,7 +350,7 @@ lbu_backTranslateString (const char *configFileList,
 			 *settingsString, unsigned int mode)
 {
   int k;
-  logMessage(LOG_INFO, "Begin lbu_backTranslateString: inbuf=%s", inbuf);
+  logMessage(LOU_LOG_INFO, "Begin lbu_backTranslateString: inbuf=%s", inbuf);
   if (!read_configuration_file
       (configFileList, logFileName, settingsString, mode))
     return 0;
@@ -363,7 +363,7 @@ lbu_backTranslateString (const char *configFileList,
   ud->inFile = ud->outFile = NULL;
   if (ud->format_for == utd)
   {
-    logMessage(LOG_DEBUG, "ud->format_for=utd");
+    logMessage(LOU_LOG_DEBUG, "ud->format_for=utd");
     k = utd_back_translate_braille_string ();
   }
   else
@@ -374,7 +374,7 @@ lbu_backTranslateString (const char *configFileList,
       return 0;
     }
   *outlen = ud->outlen_so_far;
-  logMessage(LOG_INFO, "Finish lbu_backTranslateString");
+  logMessage(LOU_LOG_INFO, "Finish lbu_backTranslateString");
   lbu_logEnd ();
   return 1;
 }
@@ -401,7 +401,7 @@ LBUAPI int EXPORT_CALL lbu_backTranslateFile
     {
       if (!(ud->inFile = fopen (inFileName, "rb")))
 	{
-	  logMessage (LOG_ERROR, "Can't open input file %s.", inFileName);
+	  logMessage (LOU_LOG_ERROR, "Can't open input file %s.", inFileName);
 	  return 0;
 	}
     }
@@ -411,7 +411,7 @@ LBUAPI int EXPORT_CALL lbu_backTranslateFile
     {
       if (!(ud->outFile = fopen (outFileName, "wb")))
 	{
-	  logMessage (LOG_ERROR, "Can't open output file %s.", outFileName);
+	  logMessage (LOU_LOG_ERROR, "Can't open output file %s.", outFileName);
 	  return 0;
 	}
     }
diff --git a/liblouisutdml/logging.c b/liblouisutdml/logging.c
index 6ef61b1..855ab2e 100644
--- a/liblouisutdml/logging.c
+++ b/liblouisutdml/logging.c
@@ -40,7 +40,7 @@ void EXPORT_CALL lbu_registerLogCallback(logcallback callback)
     logCallbackFunction = callback;
 }
 
-static logLevels logLevel = LOG_INFO;
+static logLevels logLevel = LOU_LOG_INFO;
 void EXPORT_CALL lbu_setLogLevel(logLevels level)
 {
   logLevel = level;
diff --git a/liblouisutdml/makeContents.c b/liblouisutdml/makeContents.c
index 5445065..b514928 100644
--- a/liblouisutdml/makeContents.c
+++ b/liblouisutdml/makeContents.c
@@ -99,7 +99,7 @@ initialize_contents (void)
   strcat (tempFileName, "lbx_body.temp");
   if (!(tempFile = fopen (tempFileName, "w")))
     {
-      logMessage (LOG_ERROR, "Can't open temporary file.\n");
+      logMessage (LOU_LOG_ERROR, "Can't open temporary file.\n");
       return 0;
     }
   ud->outFile = tempFile;
@@ -284,7 +284,7 @@ make_contents (void)
 
   if (!(tempFile = fopen (tempFileName, "r")))
     {
-      logMessage (LOG_ERROR, "Can't open temporary file.\n");
+      logMessage (LOU_LOG_ERROR, "Can't open temporary file.\n");
       return 0;
     }
   do
diff --git a/liblouisutdml/makeEndnotes.c b/liblouisutdml/makeEndnotes.c
index fa5d03a..3830d4e 100644
--- a/liblouisutdml/makeEndnotes.c
+++ b/liblouisutdml/makeEndnotes.c
@@ -264,7 +264,7 @@ int finish_endnote(xmlNode* node)
 	}
 	else if(endnotePtr != NULL && endnotePtr->has_endnote_pos!=0)
 	{
-		logMessage(LOG_DEBUG,"finish_endnote:Endnote with id %s already exists",get_attr_value(node));
+		logMessage(LOU_LOG_DEBUG,"finish_endnote:Endnote with id %s already exists",get_attr_value(node));
 		return 0;
 	}
 	else found_endnote=1;
@@ -442,7 +442,7 @@ int link_endnote(xmlNode* node)
 	}
 	else
 	{
-		logMessage(LOG_DEBUG,"link_endnote:Endnote with id %s already exists",get_attr_value(node));
+		logMessage(LOU_LOG_DEBUG,"link_endnote:Endnote with id %s already exists",get_attr_value(node));
 		return 0;
 	}
 	
diff --git a/liblouisutdml/paths.c b/liblouisutdml/paths.c
index f97515a..572e55d 100644
--- a/liblouisutdml/paths.c
+++ b/liblouisutdml/paths.c
@@ -48,7 +48,7 @@ addPath (const char *path)
   for (k = 0; path[k]; k++)
     if (path[k] == ',')
       {
-	logMessage (LOG_ERROR, "Path %s must not contain a comma", path);
+	logMessage (LOU_LOG_ERROR, "Path %s must not contain a comma", path);
 	return 0;
       }
   if (curLen > 0)
diff --git a/liblouisutdml/readconfig.c b/liblouisutdml/readconfig.c
index 80ff7a2..93bf3d9 100644
--- a/liblouisutdml/readconfig.c
+++ b/liblouisutdml/readconfig.c
@@ -90,9 +90,9 @@ configureError (lbu_FileInfo * nested, char *format, ...)
 #endif
   va_end (arguments);
   if (nested)
-    logMessage (LOG_ERROR, "%s:%d: %s", nested->fileName, nested->lineNumber, buffer);
+    logMessage (LOU_LOG_ERROR, "%s:%d: %s", nested->fileName, nested->lineNumber, buffer);
   else
-    logMessage (LOG_ERROR, "%s", buffer);
+    logMessage (LOU_LOG_ERROR, "%s", buffer);
   errorCount++;
 }
 
@@ -1313,7 +1313,7 @@ read_configuration_file (const char *configFileList, const char
   char subFile[MAXNAMELEN];
   int listLength;
   int currentListPos = 0;
-  logMessage(LOG_INFO, "Begin read_configuration_file");
+  logMessage(LOU_LOG_INFO, "Begin read_configuration_file");
   errorCount = 0;
   fatalErrorCount = 0;
   /*Process logFileName later, after writeablePath is set */
@@ -1464,7 +1464,7 @@ read_configuration_file (const char *configFileList, const char
       if (ud->page_right <= 0 || ud->page_bottom <= 0)
 	{
 	  logMessage
-	    (LOG_ERROR, "For UTDML paper witdth and paper height must be specified.");
+	    (LOU_LOG_ERROR, "For UTDML paper witdth and paper height must be specified.");
 	  lbu_free ();
 	  return 0;
 	}
@@ -1474,6 +1474,6 @@ read_configuration_file (const char *configFileList, const char
       ud->back_text = textDevice;
       ud->back_line_length = 70;
     }
-  logMessage(LOG_INFO, "Finish read_configuration_file");
+  logMessage(LOU_LOG_INFO, "Finish read_configuration_file");
   return 1;
 }
diff --git a/liblouisutdml/semantics.c b/liblouisutdml/semantics.c
index 91fbc53..46e5de2 100644
--- a/liblouisutdml/semantics.c
+++ b/liblouisutdml/semantics.c
@@ -106,9 +106,9 @@ semanticError (lbu_FileInfo * nested, char *format, ...)
 #endif
   va_end (arguments);
   if (nested)
-    logMessage (LOG_ERROR, "%s:%d: %s", nested->fileName, nested->lineNumber, buffer);
+    logMessage (LOU_LOG_ERROR, "%s:%d: %s", nested->fileName, nested->lineNumber, buffer);
   else
-    logMessage (LOG_ERROR, "%s", buffer);
+    logMessage (LOU_LOG_ERROR, "%s", buffer);
   errorCount++;
 }
 
@@ -870,7 +870,7 @@ sem_compileFile (const char *fileName)
   lbu_FileInfo nested;
   char completePath[MAXNAMELEN];
   int haveAppended = 0;
-  logMessage(LOG_INFO, "Begin sem_compileFile: fileName=%s", fileName);
+  logMessage(LOU_LOG_INFO, "Begin sem_compileFile: fileName=%s", fileName);
   if (!*fileName)
     return 1;			/*Probably run with defaults */
   if (strncmp (fileName, "appended_", 9) == 0)
@@ -892,7 +892,7 @@ sem_compileFile (const char *fileName)
   memset (&nested, 0, sizeof (nested));
   nested.fileName = fileName;
   nested.unedited = 1;
-  logMessage(LOG_INFO, "Loading semantic action file: %s", completePath);
+  logMessage(LOU_LOG_INFO, "Loading semantic action file: %s", completePath);
   if ((nested.in = fopen ((char *) completePath, "rb")))
     {
       while (getALine (&nested))
@@ -912,7 +912,7 @@ sem_compileFile (const char *fileName)
       return 0;
     }
   numEntries += nested.numEntries;
-  logMessage(LOG_INFO, "Finish sem_compileFile");
+  logMessage(LOU_LOG_INFO, "Finish sem_compileFile");
   return 1;
 }
 
@@ -1082,7 +1082,7 @@ printXpathNodes (xmlNodeSetPtr nodes)
   int size;
   int i;
   size = (nodes) ? nodes->nodeNr : 0;
-  logMessage (LOG_INFO, "Result (%d nodes):", size);
+  logMessage (LOU_LOG_INFO, "Result (%d nodes):", size);
   for (i = 0; i < size; ++i)
     {
       if (nodes->nodeTab[i]->type == XML_NAMESPACE_DECL)
@@ -1092,13 +1092,13 @@ printXpathNodes (xmlNodeSetPtr nodes)
 	  cur = (xmlNodePtr) ns->next;
 	  if (cur->ns)
 	    {
-	      logMessage (LOG_INFO,
+	      logMessage (LOU_LOG_INFO,
 			     "= namespace \"%s\"=\"%s\" for node %s:%s",
 			     ns->prefix, ns->href, cur->ns->href, cur->name);
 	    }
 	  else
 	    {
-	      logMessage (LOG_INFO, "= namespace \"%s\"=\"%s\" for node %s",
+	      logMessage (LOU_LOG_INFO, "= namespace \"%s\"=\"%s\" for node %s",
 			     ns->prefix, ns->href, cur->name);
 	    }
 	}
@@ -1107,18 +1107,18 @@ printXpathNodes (xmlNodeSetPtr nodes)
 	  cur = nodes->nodeTab[i];
 	  if (cur->ns)
 	    {
-	      logMessage (LOG_INFO, "= element node \"%s:%s\"",
+	      logMessage (LOU_LOG_INFO, "= element node \"%s:%s\"",
 			     cur->ns->href, cur->name);
 	    }
 	  else
 	    {
-	      logMessage (LOG_INFO, "= element node \"%s\"", cur->name);
+	      logMessage (LOU_LOG_INFO, "= element node \"%s\"", cur->name);
 	    }
 	}
       else
 	{
 	  cur = nodes->nodeTab[i];
-	  logMessage (LOG_INFO, "= node \"%s\": type %d", cur->name,
+	  logMessage (LOU_LOG_INFO, "= node \"%s\": type %d", cur->name,
 			 cur->type);
 	}
     }
@@ -1231,12 +1231,12 @@ get_sem_attr (xmlNode * node)
   HashEntry *nodeEntry = (HashEntry *) node->_private;
   if (nodeEntry != NULL)
   {
-    logMessage(LOG_DEBUG, "Node %s has nodeEntry", (const char *)node->name);
+    logMessage(LOU_LOG_DEBUG, "Node %s has nodeEntry", (const char *)node->name);
     return nodeEntry->semNum;
   }
   else
   {
-    logMessage(LOG_DEBUG, "Node %s has no nodeEntry", (const char *)node->name);
+    logMessage(LOU_LOG_DEBUG, "Node %s has no nodeEntry", (const char *)node->name);
     return no;
   }
 }
@@ -1421,10 +1421,10 @@ append_new_entries ()
     }
   fclose (semOut);
   if (haveSemanticFile)
-    logMessage (LOG_WARN, "%d new entries appended to '%s%s'.", numEntries,
+    logMessage (LOU_LOG_WARN, "%d new entries appended to '%s%s'.", numEntries,
 		  filePrefix, firstFileName);
   else
-    logMessage (LOG_WARN, "%d entries written to new semantic-action file '%s%s'.",
+    logMessage (LOU_LOG_WARN, "%d entries written to new semantic-action file '%s%s'.",
 		  numEntries, filePrefix, firstFileName);
   moreEntries = 0;
 }
@@ -1519,7 +1519,7 @@ macroError (char *format, ...)
   vsnprintf (buffer, sizeof (buffer), format, arguments);
 #endif
   va_end (arguments);
-  logMessage (LOG_ERROR, "Macro %s: %s", macroName, buffer);
+  logMessage (LOU_LOG_ERROR, "Macro %s: %s", macroName, buffer);
 }
 
 char *
@@ -1627,7 +1627,7 @@ doSemanticActions ()
       ud->main_braille_table = ud->contracted_table_name;
       if (!lou_getTable (ud->main_braille_table))
 	{
-	  logMessage (LOG_ERROR, "Cannot open main table %s", ud->main_braille_table);
+	  logMessage (LOU_LOG_ERROR, "Cannot open main table %s", ud->main_braille_table);
 	  return 0;
 	}
       break;
diff --git a/liblouisutdml/transcribe_document.c b/liblouisutdml/transcribe_document.c
index c265379..1fc44ec 100644
--- a/liblouisutdml/transcribe_document.c
+++ b/liblouisutdml/transcribe_document.c
@@ -39,7 +39,7 @@ transcribe_document (xmlNode * node)
   StyleType *style;
   xmlNode *child;
   int childrenDone = 0;
-  logMessage(LOG_DEBUG, "Begin transcribe_document");
+  logMessage(LOU_LOG_DEBUG, "Begin transcribe_document");
   ud->top = -1;
   ud->style_top = -1;
   ud->text_length = 0;
@@ -144,6 +144,6 @@ transcribe_document (xmlNode * node)
     end_style ();
   end_document ();
   pop_sem_stack ();
-  logMessage(LOG_DEBUG, "Finished transcribe_document");
+  logMessage(LOU_LOG_DEBUG, "Finished transcribe_document");
   return 1;
 }
diff --git a/liblouisutdml/transcribe_math.c b/liblouisutdml/transcribe_math.c
index 7e46d50..0ce11d5 100644
--- a/liblouisutdml/transcribe_math.c
+++ b/liblouisutdml/transcribe_math.c
@@ -44,12 +44,12 @@ transcribe_math (xmlNode * node, int action)
   StyleType *style;
   xmlNode *child;
   int branchCount = 0;
-  logMessage(LOG_INFO, "Begin transcribe_math");
+  logMessage(LOU_LOG_INFO, "Begin transcribe_math");
   if (node == NULL)
     return 0;
   if (action == 0)
     {
-      logMessage(LOG_DEBUG, "Math node action==0");
+      logMessage(LOU_LOG_DEBUG, "Math node action==0");
       insert_translation (ud->main_braille_table);
       curLink = node;
       if (ud->format_for == utd)
@@ -59,17 +59,17 @@ transcribe_math (xmlNode * node, int action)
     }
   else
     {
-      logMessage(LOG_DEBUG, "Math node action!=0");
+      logMessage(LOU_LOG_DEBUG, "Math node action!=0");
       push_sem_stack (node);
     }
   switch (ud->stack[ud->top])
     {
     case skip:
-      logMessage(LOG_DEBUG, "Math node skip");
+      logMessage(LOU_LOG_DEBUG, "Math node skip");
       pop_sem_stack ();
       return 1;
     case reverse:
-      logMessage(LOG_DEBUG, "Math node reverse");
+      logMessage(LOU_LOG_DEBUG, "Math node reverse");
       do_reverse (node);
       break;
     default:
@@ -77,7 +77,7 @@ transcribe_math (xmlNode * node, int action)
     }
   if ((style = is_style (node)) != NULL)
     {
-      logMessage(LOG_DEBUG, "Math node start style");
+      logMessage(LOU_LOG_DEBUG, "Math node start style");
       mathTrans ();
       start_style (style, node);
     }
@@ -106,14 +106,14 @@ transcribe_math (xmlNode * node, int action)
   insert_code (node, -1);
   if (style)
     {
-      logMessage(LOG_DEBUG, "Math node end style");
+      logMessage(LOU_LOG_DEBUG, "Math node end style");
       mathTrans ();
       end_style ();
     }
   pop_sem_stack ();
   if (action == 0)
     mathTrans ();
-  logMessage(LOG_INFO, "Finish transcribe_math");
+  logMessage(LOU_LOG_INFO, "Finish transcribe_math");
   return 1;
 }
 
@@ -145,7 +145,7 @@ mathTrans ()
       ud->text_length = 0;
       if (!k)
 	{
-	  logMessage (LOG_ERROR, "Could not open table %s", ud->mathexpr_table_name);
+	  logMessage (LOU_LOG_ERROR, "Could not open table %s", ud->mathexpr_table_name);
 	  ud->mathexpr_table_name = NULL;
 	  return 0;
 	}
diff --git a/liblouisutdml/transcribe_paragraph.c b/liblouisutdml/transcribe_paragraph.c
index e801516..c648139 100644
--- a/liblouisutdml/transcribe_paragraph.c
+++ b/liblouisutdml/transcribe_paragraph.c
@@ -198,7 +198,7 @@ transcribe_paragraph (xmlNode * node, int action)
   xmlNode *child;
   int branchCount = 0;
   int i;
-  logMessage(LOG_DEBUG, "Begin transcribe_paragraph");
+  logMessage(LOU_LOG_DEBUG, "Begin transcribe_paragraph");
   if (node == NULL)
     return 0;
   if (ud->top == 0)
@@ -227,7 +227,7 @@ transcribe_paragraph (xmlNode * node, int action)
       ud->main_braille_table = ud->contracted_table_name;
       if (!lou_getTable (ud->main_braille_table))
 	{
-	  logMessage (LOG_ERROR, "Cannot open main table %s", ud->main_braille_table);
+	  logMessage (LOU_LOG_ERROR, "Cannot open main table %s", ud->main_braille_table);
 	  return 0;
 	}
       if (node->children == NULL)
@@ -338,7 +338,7 @@ transcribe_paragraph (xmlNode * node, int action)
   if (is_macro (node))
     {
       haveMacro = 1;
-      logMessage(LOG_DEBUG, "Node has macro");
+      logMessage(LOU_LOG_DEBUG, "Node has macro");
       start_macro (node);
     }
   else if ((style = is_style (node)) != NULL)
@@ -349,7 +349,7 @@ transcribe_paragraph (xmlNode * node, int action)
 	    pop_sem_stack ();
 	  return 0;
 	}
-      logMessage(LOG_DEBUG, "Node has style");
+      logMessage(LOU_LOG_DEBUG, "Node has style");
       start_style (style, node);
     }
   child = node->children;
@@ -629,6 +629,6 @@ transcribe_paragraph (xmlNode * node, int action)
       insert_translation (ud->main_braille_table);
       write_paragraph (para, NULL);
     }
-  logMessage(LOG_DEBUG, "Finished transcribe_paragraph");
+  logMessage(LOU_LOG_DEBUG, "Finished transcribe_paragraph");
   return 1;
 }
diff --git a/liblouisutdml/transcriber.c b/liblouisutdml/transcriber.c
index 3322489..256038f 100644
--- a/liblouisutdml/transcriber.c
+++ b/liblouisutdml/transcriber.c
@@ -185,7 +185,7 @@ getLiblouisRule (TranslationTableOffset offset)
 int
 start_document ()
 {
-  logMessage(LOG_INFO, "Starting new document");
+  logMessage(LOU_LOG_INFO, "Starting new document");
   ud->head_node = NULL;
   initializeTranscriber();
   if (ud->has_math)
@@ -194,7 +194,7 @@ start_document ()
     firstTableName = ud->main_braille_table = ud->contracted_table_name;
   if (!(firstTableHeader = lou_getTable (ud->main_braille_table)))
     {
-      logMessage (LOG_ERROR, "Cannot open main table %s", ud->main_braille_table);
+      logMessage (LOU_LOG_ERROR, "Cannot open main table %s", ud->main_braille_table);
       return 0;
     }
   if (ud->has_contentsheader)
@@ -473,9 +473,9 @@ wc_string_to_utf8 (const widechar * inStr, int *inSize, unsigned char *outstr,
   int numBytes;
   unsigned int utf32;
   int k;
-  logMessage(LOG_DEBUG, "Begin wc_string_to_utf8: inSize=%d, outSize=%d", *inSize, *outSize);
-  logWidecharBuf(LOG_DEBUG, "inStr=", inStr, *inSize);
-  logMessage(LOG_DEBUG, "inStr=%d, outstr=%d", inStr, outstr);
+  logMessage(LOU_LOG_DEBUG, "Begin wc_string_to_utf8: inSize=%d, outSize=%d", *inSize, *outSize);
+  logWidecharBuf(LOU_LOG_DEBUG, "inStr=", inStr, *inSize);
+  logMessage(LOU_LOG_DEBUG, "inStr=%d, outstr=%d", inStr, outstr);
   while (in < *inSize)
     {
       utf32 = inStr[in++];
@@ -502,24 +502,24 @@ wc_string_to_utf8 (const widechar * inStr, int *inSize, unsigned char *outstr,
 	    {
 	      *inSize = in;
 	      *outSize = out;
-              logMessage(LOG_DEBUG, "Finish wc_string_to_utf8 due to not enough memory in outstr");
+              logMessage(LOU_LOG_DEBUG, "Finish wc_string_to_utf8 due to not enough memory in outstr");
 	      return 1;
 	    }
 	}
-      logMessage(LOG_DEBUG, "Adding UTF8 character to output");
+      logMessage(LOU_LOG_DEBUG, "Adding UTF8 character to output");
       for (k = 0; k < utf8Length; k++)
       {
-        logMessage(LOG_DEBUG, "out=%d, k=%d, utf8Str[%d]=%c", out, k, k, utf8Str[k]);
+        logMessage(LOU_LOG_DEBUG, "out=%d, k=%d, utf8Str[%d]=%c", out, k, k, utf8Str[k]);
         outstr[out++] = utf8Str[k];
       }
-      logMessage(LOG_DEBUG, "Moving to next character");
+      logMessage(LOU_LOG_DEBUG, "Moving to next character");
     }
   // We normally want to null terminate the string but should not if it will not fit in allocated memory
   if (out < *outSize)
     outstr[out++] = 0;
   *inSize = in;
   *outSize = out;
-  logMessage(LOG_DEBUG, "Finish wc_string_to_utf8: outstr=%s, outSize=%d", outstr, *outSize);
+  logMessage(LOU_LOG_DEBUG, "Finish wc_string_to_utf8: outstr=%s, outSize=%d", outstr, *outSize);
   return 1;
 }
 
@@ -595,7 +595,7 @@ utf8ToWc (const unsigned char *utf8str, int *inSize, widechar *
       if (CHARSIZE == 2 && utf32 > 0xffff)
 	{
 	  utf32 = 0xfffd;
-	  logMessage(LOG_WARN, "Warning: Character 0x%.4x out of range, substituting with u+fffd", utf32);
+	  logMessage(LOU_LOG_WARN, "Warning: Character 0x%.4x out of range, substituting with u+fffd", utf32);
 	}
       utfwcstr[out++] = (widechar) utf32;
       if (out >= *outSize)
@@ -772,33 +772,33 @@ insert_translation (const char *table)
   int translationLength;
   int translatedLength;
   int k;
-  logMessage(LOG_DEBUG, "Begin insert_translation");
+  logMessage(LOU_LOG_DEBUG, "Begin insert_translation");
   if (style->translation_table != NULL)
     table = style->translation_table;
   if (table == NULL)
     {
       memset (ud->typeform, 0, sizeof (ud->typeform));
       ud->text_length = 0;
-      logMessage(LOG_DEBUG, "Finished insert_translation, table not defined");
+      logMessage(LOU_LOG_DEBUG, "Finished insert_translation, table not defined");
       return 0;
     }
   if (ud->text_length == 0)
   {
-    logMessage(LOG_DEBUG, "Finished insert_translation, no text to translate");
+    logMessage(LOU_LOG_DEBUG, "Finished insert_translation, no text to translate");
     return 1;
   }
   for (k = 0; k < ud->text_length && ud->text_buffer[k] <= 32; k++);
   if (k == ud->text_length)
     {
       ud->text_length = 0;
-      logMessage(LOG_DEBUG, "Finished insert_translation, only whitespace");
+      logMessage(LOU_LOG_DEBUG, "Finished insert_translation, only whitespace");
       return 1;
     }
   if (styleSpec != NULL && styleSpec->status == resumeBody)
     styleSpec->status = bodyInterrupted;
   if (ud->format_for == utd)
   {
-    logMessage(LOG_DEBUG, "Finished insert_translation, delegating to utd_insert_translation");
+    logMessage(LOU_LOG_DEBUG, "Finished insert_translation, delegating to utd_insert_translation");
     return (utd_insert_translation (table));
   }
   if (ud->translated_length > 0 && ud->translated_length <
@@ -833,7 +833,7 @@ insert_translation (const char *table)
   ud->text_length = 0;
   if (!k)
     {
-      logMessage (LOG_ERROR, "Cannot find table %s", table);
+      logMessage (LOU_LOG_ERROR, "Cannot find table %s", table);
       return 0;
     }
   if (ud->in_sync)
@@ -853,11 +853,11 @@ insert_translation (const char *table)
       ud->translated_length = MAX_TRANS_LENGTH;
       if (!write_paragraph (para, NULL))
       {
-        logMessage(LOG_DEBUG, "Finished insert_translation, issue with write_paragraph");
+        logMessage(LOU_LOG_DEBUG, "Finished insert_translation, issue with write_paragraph");
 	return 0;
       }
     }
-  logMessage(LOG_DEBUG, "Finished insert_translation");
+  logMessage(LOU_LOG_DEBUG, "Finished insert_translation");
   return 1;
 }
 
@@ -1170,7 +1170,7 @@ insert_text (xmlNode * node)
   int length = strlen ((char *) node->content);
   int k;
   // int stripSpace = 0;
-  logMessage(LOG_DEBUG, "Begin insert_text: node->content=%s", node->content);
+  logMessage(LOU_LOG_DEBUG, "Begin insert_text: node->content=%s", node->content);
   // for (k = length; k > 0 && node->content[k - 1] <= 32; k--);
     // We want to track if the node only contains space 0x20 characters
     // if (node->content[k - 1] != 32)
@@ -1186,7 +1186,7 @@ insert_text (xmlNode * node)
   if (ud->format_for == utd)
     {
       utd_insert_text (node, length);
-      logMessage(LOG_DEBUG, "Finished insert_text");
+      logMessage(LOU_LOG_DEBUG, "Finished insert_text");
       return;
     }
   switch (ud->stack[ud->top])
@@ -1208,11 +1208,11 @@ insert_text (xmlNode * node)
 	}
       ud->translated_length += ud->text_length;
       ud->text_length = 0;
-      logMessage(LOG_DEBUG, "Finished insert_text, notranslate action used");
+      logMessage(LOU_LOG_DEBUG, "Finished insert_text, notranslate action used");
       return;
     case pagenum:
       handlePagenum (node->content, length);
-      logMessage(LOG_DEBUG, "Finished insert_text, pagenum action used");
+      logMessage(LOU_LOG_DEBUG, "Finished insert_text, pagenum action used");
       return;
     default:
       break;
@@ -1220,7 +1220,7 @@ insert_text (xmlNode * node)
   ud->old_text_length = ud->text_length;
   insert_utf8 (node->content);
   setEmphasis ();
-  logMessage(LOG_DEBUG, "Finished insert_text");
+  logMessage(LOU_LOG_DEBUG, "Finished insert_text");
 }
 
 static int
@@ -3149,11 +3149,11 @@ int
 write_paragraph (sem_act action, xmlNode * node)
 {
   StyleType *holdStyle;
-  logMessage(LOG_DEBUG, "Begin write_paragraph");
+  logMessage(LOU_LOG_DEBUG, "Begin write_paragraph");
   if (!((ud->text_length > 0 || ud->translated_length > 0) &&
 	ud->style_top >= 0))
   {
-    logMessage(LOG_DEBUG, "Finished write_paragraph, no text translated");
+    logMessage(LOU_LOG_DEBUG, "Finished write_paragraph, no text translated");
     return 1;
   }
   holdStyle = action_to_style (action);
@@ -3191,7 +3191,7 @@ write_paragraph (sem_act action, xmlNode * node)
   styleBody ();
   end_style ();
   ud->needs_editing = 0;
-  logMessage(LOG_DEBUG, "Finish write_paragraph");
+  logMessage(LOU_LOG_DEBUG, "Finish write_paragraph");
   return 1;
 }
 
@@ -3220,7 +3220,7 @@ makeParagraph ()
   int charactersWritten = 0;
   int pieceStart;
   int k;
-  logMessage(LOG_DEBUG, "Begin makeParagraph");
+  logMessage(LOU_LOG_DEBUG, "Begin makeParagraph");
   while (ud->text_length > 0 && ud->text_buffer[ud->text_length - 1] <=
 	 32 && ud->text_buffer[ud->text_length - 1] != escapeChar)
     ud->text_length--;
@@ -3240,7 +3240,7 @@ makeParagraph ()
       translationLength++;
     }
   translatedLength = MAX_TRANS_LENGTH;
-  logMessage(LOG_DEBUG, "About to perform back translation");
+  logMessage(LOU_LOG_DEBUG, "About to perform back translation");
   if (!lou_backTranslateString (ud->main_braille_table,
 				ud->text_buffer, &translationLength,
 				&ud->translated_buffer[0],
@@ -3340,7 +3340,7 @@ makeParagraph ()
     return 0;
   writeOutbuf ();
   ud->text_length = 0;
-  logMessage(LOG_DEBUG, "Finish makeParagraph");
+  logMessage(LOU_LOG_DEBUG, "Finish makeParagraph");
   return 1;
 }
 
@@ -3415,7 +3415,7 @@ back_translate_braille_string ()
   int newPage = 0;
   char *htmlStart = "<html><head><title>No Title</title></head><body>";
   char *htmlEnd = "</body></html>";
-  logMessage(LOG_DEBUG, "Begin back_translate_braille_string");
+  logMessage(LOU_LOG_DEBUG, "Begin back_translate_braille_string");
   if (ud->format_for == utd)
     return utd_back_translate_braille_string ();
   if (!start_document ())
@@ -3486,7 +3486,7 @@ back_translate_braille_string ()
       writeOutbuf ();
       ud->output_encoding = ascii8;
     }
-  logMessage(LOG_DEBUG, "Finish back_translate_braille_string");
+  logMessage(LOU_LOG_DEBUG, "Finish back_translate_braille_string");
   return 1;
 }
 
@@ -3646,14 +3646,14 @@ addBoxline(const char *boxChar, int beforeAfter)
   widechar dots;
   if (ud->format_for == utd)
     return utd_addBoxline(boxChar, beforeAfter);
-  logMessage(LOG_DEBUG, "Begin addBoxline");
-  logMessage(LOG_DEBUG, "styleSpec->node->name=%s", styleSpec->node->name);
+  logMessage(LOU_LOG_DEBUG, "Begin addBoxline");
+  logMessage(LOU_LOG_DEBUG, "styleSpec->node->name=%s", styleSpec->node->name);
   while (availableCells != ud->cells_per_line)
   {
     finishLine();
     availableCells = startLine();
   }
-  logMessage(LOG_DEBUG, "availableCells=%d", availableCells);
+  logMessage(LOU_LOG_DEBUG, "availableCells=%d", availableCells);
   if (!lou_charToDots(ud->main_braille_table, &wTmpBuf, &dots, 1, 0))
     return 0;
   for (k = 0; k < availableCells; k++)
@@ -3663,7 +3663,7 @@ addBoxline(const char *boxChar, int beforeAfter)
   ud->outbuf1_len_so_far += availableCells;
   cellsWritten += availableCells;
   finishLine();
-  logMessage(LOG_DEBUG, "Finished addBoxline");
+  logMessage(LOU_LOG_DEBUG, "Finished addBoxline");
   return 1;
 }
 
@@ -3679,7 +3679,7 @@ utd_addBoxline(const char *boxChar, int beforeAfter)
   // Make sure that styleSpec relates to a node
   if (styleSpec->node == NULL)
     return 0;
-  logMessage(LOG_DEBUG, "Begin utd_addBoxline");
+  logMessage(LOU_LOG_DEBUG, "Begin utd_addBoxline");
   // We should catch the current brlNode so we can restore afterwards
   tmpBrlNode = brlNode;
   // Create the brl node for the boxline
@@ -3716,7 +3716,7 @@ utd_addBoxline(const char *boxChar, int beforeAfter)
   utd_finishLine(0, 0);
   // Restore original brlNode
   brlNode = tmpBrlNode;
-  logMessage(LOG_DEBUG, "Finish utd_addBoxline");
+  logMessage(LOU_LOG_DEBUG, "Finish utd_addBoxline");
   return 1;
 }
 
@@ -3787,7 +3787,7 @@ do_linespacing (xmlNode * node)
 int
 start_style (StyleType * curStyle, xmlNode * node)
 {
-  logMessage(LOG_DEBUG, "Begin start_style");
+  logMessage(LOU_LOG_DEBUG, "Begin start_style");
   if (curStyle == NULL)
     curStyle = lookup_style ("para");
   if (prevStyle == NULL)
@@ -3837,14 +3837,14 @@ start_style (StyleType * curStyle, xmlNode * node)
     return 1;
   startStyle ();
   styleSpec->status = startBody;
-  logMessage(LOG_DEBUG, "Finish start_style");
+  logMessage(LOU_LOG_DEBUG, "Finish start_style");
   return 1;
 }
 
 int
 end_style ()
 {
-  logMessage(LOG_DEBUG, "Begin end_style");
+  logMessage(LOU_LOG_DEBUG, "Begin end_style");
   styleSpec = &ud->style_stack[ud->style_top];
   style = styleSpec->style;
   ud->brl_page_num_format = styleSpec->curBrlNumFormat;
@@ -3874,7 +3874,7 @@ end_style ()
   ud->style_right_margin = styleSpec->curRightMargin;
   ud->style_first_line_indent = styleSpec->curFirstLineIndent;
   ud->needs_editing = 0;
-  logMessage(LOG_DEBUG, "Finish end_style");
+  logMessage(LOU_LOG_DEBUG, "Finish end_style");
   return 1;
 }
 
@@ -3969,13 +3969,13 @@ processDaisyDoc ()
   int haveSemanticFile;
   if (ud->doc == NULL)
     {
-      logMessage (LOG_FATAL, "Document could not be processed");
+      logMessage (LOU_LOG_FATAL, "Document could not be processed");
       return 0;
     }
   rootElement = xmlDocGetRootElement (ud->doc);
   if (rootElement == NULL)
     {
-      logMessage (LOG_FATAL, "Document is empty");
+      logMessage (LOU_LOG_FATAL, "Document is empty");
       return 0;
     }
   haveSemanticFile = compile_semantic_table (rootElement);
@@ -4000,7 +4000,7 @@ makeDaisyDoc but not
 * procesDaisyDoc. */
   if (ud->doc == NULL)
     {
-      logMessage (LOG_FATAL, "Document could not be processed");
+      logMessage (LOU_LOG_FATAL, "Document could not be processed");
       return 0;
     }
   xmlFreeDoc (ud->doc);
@@ -4163,7 +4163,7 @@ backTranslateBlock (xmlNode * curBlock, xmlNode * curBrl)
   int goodTrans;
   int pos;
   int k, kk;
-  logMessage(LOG_DEBUG, "Begin backTranslateBlock");
+  logMessage(LOU_LOG_DEBUG, "Begin backTranslateBlock");
   if (curBlock == NULL || curBrl == NULL)
     return 1;
   ud->text_length = 0;
@@ -4225,7 +4225,7 @@ backTranslateBlock (xmlNode * curBlock, xmlNode * curBrl)
       utilStringBuf[--kk] = 0;
       xmlNewProp (addBrl, (xmlChar *) "index", (xmlChar *) utilStringBuf);
     }
-  logMessage(LOG_DEBUG, "Finish backTranslateBlock");
+  logMessage(LOU_LOG_DEBUG, "Finish backTranslateBlock");
   return 1;
 }
 
@@ -4235,7 +4235,7 @@ makeDotsTextNode (xmlNode * node, const widechar * content, int length,
 {
   xmlNode *textNode;
   int inlen, outlen;
-  logMessage(LOG_DEBUG, "Begin makeDotsTextNode");
+  logMessage(LOU_LOG_DEBUG, "Begin makeDotsTextNode");
   if (length <= 0)
     return 1;
   if (ud->mode & notUC)
@@ -4272,10 +4272,10 @@ makeDotsTextNode (xmlNode * node, const widechar * content, int length,
     }
   outlen = maxContent;
   wc_string_to_utf8 (ud->text_buffer, &inlen, brlContent, &outlen);
-  logMessage(LOG_DEBUG, "brlContent=%s", brlContent);
+  logMessage(LOU_LOG_DEBUG, "brlContent=%s", brlContent);
   textNode = xmlNewText (brlContent);
   xmlAddChild (node, textNode);
-  logMessage(LOG_DEBUG, "Finished makeDotsTextNode");
+  logMessage(LOU_LOG_DEBUG, "Finished makeDotsTextNode");
   return 1;
 }
 
@@ -4287,7 +4287,7 @@ formatBackBlock ()
   xmlNode *newBlock;
   xmlNode *curBrl;
   int k;
-  logMessage(LOG_DEBUG, "Begin formatBackBlock");
+  logMessage(LOU_LOG_DEBUG, "Begin formatBackBlock");
   if (ud->translated_length <= 0)
     return 1;
   newBlock = xmlNewNode (NULL, (xmlChar *) "p");
@@ -4296,7 +4296,7 @@ formatBackBlock ()
   ud->translated_length = ud->sync_text_length = 0;
   ud->in_sync = 1;
   backTranslateBlock (xmlAddChild (addBlock, newBlock), curBrl);
-  logMessage(LOG_DEBUG, "Finish formatBackBlock");
+  logMessage(LOU_LOG_DEBUG, "Finish formatBackBlock");
   return 1;
 }
 
@@ -4358,7 +4358,7 @@ utd_back_translate_braille_string ()
   int pch = 0;
   int leadingBlanks = 0;
   int k;
-  logMessage(LOG_DEBUG, "Begin utd_back_trranslate_braille_string");
+  logMessage(LOU_LOG_DEBUG, "Begin utd_back_trranslate_braille_string");
   ud->main_braille_table = ud->contracted_table_name;
   if (!lou_getTable (ud->main_braille_table))
     return 0;
@@ -4398,7 +4398,7 @@ utd_back_translate_braille_string ()
   ud->in_sync = ud->hyphenate;
   utd_finish ();
   freeDaisyDoc ();
-  logMessage(LOG_DEBUG, "Finish utd_back_translate_braille_string");
+  logMessage(LOU_LOG_DEBUG, "Finish utd_back_translate_braille_string");
   return 1;
 }
 
@@ -4448,7 +4448,7 @@ checkTextFragment (widechar * text, int length)
 static int
 insertTextFragment (widechar * content, int length)
 {
-  logMessage(LOG_DEBUG, "Begin insertTextFragment");
+  logMessage(LOU_LOG_DEBUG, "Begin insertTextFragment");
   if (length <= 0)
     return 1;
   checkTextFragment (content, length);
@@ -4469,30 +4469,30 @@ static PageStatus
 checkPageStatus ()
 {
   int remaining;
-  logMessage(LOG_DEBUG, "Begin checkPageStatus");
+  logMessage(LOU_LOG_DEBUG, "Begin checkPageStatus");
   if (ud->vert_line_pos == ud->page_top || ud->lines_on_page == 0)
   {
-    logMessage(LOG_DEBUG, "Finish checkPageStatus: return=topOfPage");
+    logMessage(LOU_LOG_DEBUG, "Finish checkPageStatus: return=topOfPage");
     return topOfPage;
   }
   remaining = ud->page_bottom - ud->vert_line_pos;
   if (remaining < ud->normal_line || ud->lines_on_page >= ud->lines_per_page)
   {
-    logMessage(LOG_DEBUG, "Finish checkPageStatus: return=bottomOfPage");
+    logMessage(LOU_LOG_DEBUG, "Finish checkPageStatus: return=bottomOfPage");
     return bottomOfPage;
   }
   if ((ud->lines_on_page + 1) >= ud->lines_per_page || remaining ==
       ud->normal_line)
   {
-    logMessage(LOG_DEBUG, "Finish checkPageStatus: return=lastLine");
+    logMessage(LOU_LOG_DEBUG, "Finish checkPageStatus: return=lastLine");
     return lastLine;
   }
   if (remaining > (2 * ud->normal_line) && remaining < (3 * ud->normal_line))
   {
-    logMessage(LOG_DEBUG, "Finish checkPageStatus: return=nearBottom");
+    logMessage(LOU_LOG_DEBUG, "Finish checkPageStatus: return=nearBottom");
     return nearBottom;
   }
-  logMessage(LOG_DEBUG, "Finish checkPageStatus: return=midPage");
+  logMessage(LOU_LOG_DEBUG, "Finish checkPageStatus: return=midPage");
   return midPage;
 }
 
@@ -4856,12 +4856,12 @@ makeNewpage (xmlNode * parent)
 {
   char number[MAXNUMLEN];
   xmlNode *newNode = xmlNewNode (NULL, (xmlChar *) "newpage");
-  logMessage(LOG_DEBUG, "Begin makeNewpage");
+  logMessage(LOU_LOG_DEBUG, "Begin makeNewpage");
   sprintf (number, "%d", ud->braille_page_number);
   xmlNewProp (newNode, (xmlChar *) "brlnumber", (xmlChar *) number);
   newpageNode = xmlAddChild (parent, newNode);
   ud->lines_on_page = 0;
-  logMessage(LOG_DEBUG, "Finish makeNewpage");
+  logMessage(LOU_LOG_DEBUG, "Finish makeNewpage");
   return 1;
 }
 
@@ -4889,7 +4889,7 @@ assignIndices (xmlNode * startNode, int startPos)
   int firstIndex;
   int curPos = startPos;
   xmlNode *curBrlNode;
-  logMessage(LOG_DEBUG, "Begin assignIndices");
+  logMessage(LOU_LOG_DEBUG, "Begin assignIndices");
   if (indices == NULL)
     return 1;
   if (startNode == NULL)
@@ -4916,9 +4916,9 @@ assignIndices (xmlNode * startNode, int startPos)
 	      kk += posLen;
 	      indexPos++;
 	    }
-          logMessage(LOG_DEBUG, "indexPos=%d", indexPos);
+          logMessage(LOU_LOG_DEBUG, "indexPos=%d", indexPos);
 	  utilStringBuf[--kk] = 0;
-          logMessage(LOG_DEBUG, "utilStringBuf=%s", utilStringBuf);
+          logMessage(LOU_LOG_DEBUG, "utilStringBuf=%s", utilStringBuf);
 	  if (xmlGetProp (curBrlNode, (xmlChar *) "index") == NULL && indexPos > 0)
 	    xmlNewProp (curBrlNode, (xmlChar *) "index", (xmlChar *)
 			utilStringBuf);
@@ -4928,7 +4928,7 @@ assignIndices (xmlNode * startNode, int startPos)
 	}
       nextSegment = curPos + 1;
     }
-  logMessage(LOG_DEBUG, "Finish assignIndices");
+  logMessage(LOU_LOG_DEBUG, "Finish assignIndices");
   return 1;
 }
 
@@ -4940,7 +4940,7 @@ utd_insert_translation (const char *table)
   int oldUdTranslatedLength = ud->translated_length;
   int k;
   int *setIndices;
-  logMessage(LOG_DEBUG, "Begin utd_insert_translation");
+  logMessage(LOU_LOG_DEBUG, "Begin utd_insert_translation");
   if (table != currentTable)
     {
       for (k = strlen (table); k >= 0; k--)
@@ -4970,7 +4970,7 @@ utd_insert_translation (const char *table)
   ud->text_length = 0;
   if (!k)
     {
-      logMessage (LOG_ERROR, "Could not open table %s", table);
+      logMessage (LOU_LOG_ERROR, "Could not open table %s", table);
       table = NULL;
       return 0;
     }
@@ -4979,7 +4979,7 @@ utd_insert_translation (const char *table)
   else
     ud->translated_length = MAX_TRANS_LENGTH;
   assignIndices (startNode, oldUdTranslatedLength);
-  logMessage(LOG_DEBUG, "Finish utd_insert_translation");
+  logMessage(LOU_LOG_DEBUG, "Finish utd_insert_translation");
   return 1;
 }
 
@@ -5103,7 +5103,7 @@ utd_startLine ()
 {
   PageStatus curPageStatus;
   int availableCells = 0;
-  logMessage(LOG_DEBUG, "Begin utd_startLine");
+  logMessage(LOU_LOG_DEBUG, "Begin utd_startLine");
   if (firstPage)
     {
       firstPage = 0;
@@ -5144,7 +5144,7 @@ utd_startLine ()
       else
 	availableCells = ud->cells_per_line;
     }
-  logMessage(LOG_DEBUG, "Finished utd_startLine");
+  logMessage(LOU_LOG_DEBUG, "Finished utd_startLine");
   return availableCells;
 }
 
@@ -5159,7 +5159,7 @@ utd_finishLine (int leadingBlanks, int length)
   int horizLinePos = ud->page_left + leadingBlanks * ud->cell_width;
   if (newlineNode == NULL)
     return 1;
-  logMessage(LOG_DEBUG, "Begin utd_finishLine");
+  logMessage(LOU_LOG_DEBUG, "Begin utd_finishLine");
   cellsOnLine = leadingBlanks + length;
   for (leaveBlank = -1; leaveBlank < ud->line_spacing; leaveBlank++)
     {
@@ -5230,7 +5230,7 @@ utd_finishLine (int leadingBlanks, int length)
       ud->vert_line_pos = ud->page_top;
       makeNewpage (brlNode);
     }
-  logMessage(LOG_DEBUG, "Finish utd_finishLine");
+  logMessage(LOU_LOG_DEBUG, "Finish utd_finishLine");
   return 1;
 }
 
@@ -5246,10 +5246,10 @@ utd_doOrdinaryText ()
   int charactersWritten = 0;
   int newLineNeeded = 1;
   brlNode = firstBrlNode;
-  logMessage(LOG_DEBUG, "Begin utd_doOrdinaryText");
+  logMessage(LOU_LOG_DEBUG, "Begin utd_doOrdinaryText");
   while (brlNode)
     {
-      logMessage(LOG_DEBUG, "Finding brlNode content");
+      logMessage(LOU_LOG_DEBUG, "Finding brlNode content");
       do
 	{
 	  if (newLineNeeded)
@@ -5314,7 +5314,7 @@ utd_doOrdinaryText ()
       prevBrlNode->_private = NULL;
     }
   brlNode = prevBrlNode;	/*for utd_finishStyle */
-  logMessage(LOG_DEBUG, "Finish utd_doOrdinaryText");
+  logMessage(LOU_LOG_DEBUG, "Finish utd_doOrdinaryText");
   return 1;
 }
 static int
@@ -5344,7 +5344,7 @@ static int
 utd_fillPage ()
 {
   PageStatus curPageStatus = checkPageStatus ();
-  logMessage(LOG_DEBUG, "Begin utd_fillPage");
+  logMessage(LOU_LOG_DEBUG, "Begin utd_fillPage");
   if (curPageStatus == topOfPage)
     {
       utd_startLine ();
@@ -5353,7 +5353,7 @@ utd_fillPage ()
   ud->vert_line_pos = ud->page_bottom - ud->normal_line;
   utd_startLine ();
   utd_finishLine (0, 0);
-  logMessage(LOG_DEBUG, "Finish utd_fillPage");
+  logMessage(LOU_LOG_DEBUG, "Finish utd_fillPage");
   return 1;
 }
 
@@ -5364,7 +5364,7 @@ utd_doComputerCode ()
   int cellsToWrite = 0;
   int availableCells = 0;
   int k;
-  logMessage(LOG_DEBUG, "Begin utd_doComputerCode");
+  logMessage(LOU_LOG_DEBUG, "Begin utd_doComputerCode");
   while (translatedBuffer[charactersWritten] == CR)
     charactersWritten++;
   while (charactersWritten < translatedLength)
@@ -5419,7 +5419,7 @@ utd_doAlignColumns ()
   int k;
   unsigned int ch;
   int rowEnd = 0;
-  logMessage(LOG_DEBUG, "Begin utd_doAlignColumns");
+  logMessage(LOU_LOG_DEBUG, "Begin utd_doAlignColumns");
   for (bufPos = 0; bufPos < translatedLength; bufPos++)
     if (translatedBuffer[bufPos] == ESCAPE)
       break;
@@ -5581,7 +5581,7 @@ utd_doAlignColumns ()
 	  utd_finishLine (0, cellsToWrite);
 	}
     }
-  logMessage(LOG_DEBUG, "Finish utd_doAlignColumns");
+  logMessage(LOU_LOG_DEBUG, "Finish utd_doAlignColumns");
   return 1;
 }
 
@@ -5636,7 +5636,7 @@ utd_editTrans ()
 	   NULL, NULL, dotsIO))
 	{
 	  logMessage
-	    (LOG_FATAL, "edit table '%s' could not be found or contains errors",
+	    (LOU_LOG_FATAL, "edit table '%s' could not be found or contains errors",
 	     ud->edit_table_name);
 	  ud->edit_table_name = NULL;
 	  return 0;
@@ -5654,7 +5654,7 @@ static int
 utd_styleBody ()
 {
   sem_act action;
-  logMessage(LOG_DEBUG, "Begin utd_styleBody");
+  logMessage(LOU_LOG_DEBUG, "Begin utd_styleBody");
   if (!utd_editTrans ())
     return 0;
   if (!ud->paragraphs)
@@ -5709,7 +5709,7 @@ utd_styleBody ()
   ud->sync_text_length = 0;
   ud->in_sync = ud->hyphenate;
   firstBrlNode = NULL;
-  logMessage(LOG_DEBUG, "Finish utd_styleBody");
+  logMessage(LOU_LOG_DEBUG, "Finish utd_styleBody");
   return 1;
 }
 
@@ -5717,7 +5717,7 @@ static int
 utd_finishStyle ()
 {
   PageStatus curPageStatus = checkPageStatus ();
-  logMessage(LOG_DEBUG, "Begin utd_finishStyle");
+  logMessage(LOU_LOG_DEBUG, "Begin utd_finishStyle");
   if (style->bottomBoxline[0])
   {
     utd_addBoxline(style->bottomBoxline, 1);
@@ -5737,7 +5737,7 @@ utd_finishStyle ()
 	}
     }
   brlNode = firstBrlNode = NULL;
-  logMessage(LOG_DEBUG, "Finish utd_finishStyle");
+  logMessage(LOU_LOG_DEBUG, "Finish utd_finishStyle");
   return 1;
 }
 
@@ -5801,7 +5801,7 @@ output_xml (xmlDoc * doc)
       xmlDocDumpMemory (doc, &dumpLoc, &dumpSize);
       if (dumpSize > (CHARSIZE * ud->outlen))
 	{
-	  logMessage (LOG_ERROR, "output buffer too small");
+	  logMessage (LOU_LOG_ERROR, "output buffer too small");
 	  ud->outlen_so_far = 0;
 	}
       else
@@ -5818,7 +5818,7 @@ static int
 utd_finish ()
 {
   xmlNode *newNode;
-  logMessage(LOG_DEBUG, "Begin utd_finish");
+  logMessage(LOU_LOG_DEBUG, "Begin utd_finish");
   if (ud->paragraphs)
     {
       newNode = xmlNewNode (NULL, (xmlChar *) "brl");
@@ -5853,6 +5853,6 @@ bottomMargin=%d", ud->braille_page_number, firstTableName, (int) ud->dpi, ud->pa
     convert_utd ();
   else
     output_xml (ud->doc);
-  logMessage(LOG_DEBUG, "Finish utd_finish");
+  logMessage(LOU_LOG_DEBUG, "Finish utd_finish");
   return 1;
 }
diff --git a/liblouisutdml/utd2brf.c b/liblouisutdml/utd2brf.c
index cfcdd17..ecfaf18 100644
--- a/liblouisutdml/utd2brf.c
+++ b/liblouisutdml/utd2brf.c
@@ -83,7 +83,7 @@ brf_findBrlNodes (xmlNode * node)
     case utdmeta:
       return 1;
     case utdbrl:
-      logMessage(LOG_DEBUG, "Processing brl node");
+      logMessage(LOU_LOG_DEBUG, "Processing brl node");
       brf_doBrlNode (node, 0);
       pop_sem_stack ();
       return 1;
@@ -125,18 +125,18 @@ brf_insertCharacters (const char *text, int length)
 static int
 brf_doDotsText (xmlNode * node)
 {
-  logMessage(LOG_DEBUG, "brf_doDotsText %s", node->content);
+  logMessage(LOU_LOG_DEBUG, "brf_doDotsText %s", node->content);
   ud->text_length = 0;
   insert_utf8 (node->content);
   if ((ud->outbuf1_len_so_far + ud->text_length) > ud->outbuf1_len)
     brf_saveBuffer ();
-  logMessage(LOG_DEBUG, "text_buffer: %s", ud->text_buffer);
+  logMessage(LOU_LOG_DEBUG, "text_buffer: %s", ud->text_buffer);
   if (!lou_dotsToChar (ud->main_braille_table, ud->text_buffer,
 		       &ud->outbuf1[ud->outbuf1_len_so_far],
 		       ud->text_length, 0))
     return 0;
-  logMessage(LOG_DEBUG, "ud->textLength %d", ud->text_length);
-  logMessage(LOG_DEBUG, "ud->outbuf1: %s", &ud->outbuf1[ud->outbuf1_len_so_far+1]);
+  logMessage(LOU_LOG_DEBUG, "ud->textLength %d", ud->text_length);
+  logMessage(LOU_LOG_DEBUG, "ud->outbuf1: %s", &ud->outbuf1[ud->outbuf1_len_so_far+1]);
   ud->outbuf1_len_so_far += ud->text_length;
   return 1;
 }
diff --git a/tools/file2brl.c b/tools/file2brl.c
index 7b0fed7..f927b1d 100644
--- a/tools/file2brl.c
+++ b/tools/file2brl.c
@@ -115,8 +115,8 @@ main (int argc, char **argv)
   UserData *ud;
 
   int optc;
-  lbu_setLogLevel(LOG_DEBUG);
-  lou_setLogLevel(LOG_DEBUG);
+  lbu_setLogLevel(LOU_LOG_DEBUG);
+  lou_setLogLevel(LOU_LOG_DEBUG);
   set_program_name (argv[0]);
   logFileName[0] = 0;
   
@@ -213,7 +213,7 @@ main (int argc, char **argv)
     {
       if (!(inputFile = fopen (inputFileName, "r")))
 	{
-	  logMessage (LOG_FATAL, "Can't open input file %s.\n", inputFileName);
+	  logMessage (LOU_LOG_FATAL, "Can't open input file %s.\n", inputFileName);
 	  exit (EXIT_FAILURE);
 	}
     }
@@ -224,7 +224,7 @@ main (int argc, char **argv)
   strcat (tempFileName, "file2brl.temp");
   if (!(tempFile = fopen (tempFileName, "w")))
     {
-      logMessage (LOG_FATAL, "Can't open temporary file.\n");
+      logMessage (LOU_LOG_FATAL, "Can't open temporary file.\n");
       exit (EXIT_FAILURE);
     }
   if (whichProc == 'p')
@@ -353,7 +353,7 @@ main (int argc, char **argv)
 	  exit (EXIT_FAILURE);
 	break;
       default:
-	logMessage (LOG_FATAL, "Program bug %c\n", whichProc);
+	logMessage (LOU_LOG_FATAL, "Program bug %c\n", whichProc);
 	break;
       }
   lbu_free ();
