]> gitweb.michael.orlitzky.com - dead/htsn.git/blobdiff - src/Logging.hs
Add more code documentation.
[dead/htsn.git] / src / Logging.hs
index 8e80ac96414e7f5ad8bfc9d6cdd278bfde641acd..ede739a28ba9a9027bbbebc894dc51a5ad0cdd18 100644 (file)
@@ -26,20 +26,30 @@ import System.Log.Logger (
   warningM )
 
 
+-- | Log a message at the DEBUG level.
 log_debug :: String -> IO ()
 log_debug = debugM rootLoggerName
 
+-- | Log a message at the ERROR level.
 log_error :: String -> IO ()
 log_error = errorM rootLoggerName
 
+-- | Log a message at the INFO level.
 log_info :: String -> IO ()
 log_info = infoM rootLoggerName
 
+-- | Log a message at the WARNING level.
 log_warning :: String -> IO ()
 log_warning = warningM rootLoggerName
 
 
--- | Why don't we take a Configuration as an argument? Because it
+-- | Set up the logging. All logs are handled by the global "root"
+--   logger provided by HSLogger. We remove all of its handlers so
+--   that it does nothing; then we conditionally add back two handlers
+--   -- one for syslog, and one for a normal file -- dependent upon
+--   the 'syslog' and 'log_file' configuration items.
+--
+--   Why don't we take a Configuration as an argument? Because it
 --   would create circular imports!
 init_logging :: Maybe FilePath -> Priority -> Bool -> IO ()
 init_logging log_file log_level syslog = do