Rule regexp creator.
Bug fixes in logError and logDebug.