]> gitweb.michael.orlitzky.com - dead/htsn-common.git/blobdiff - src/Network/Services/TSN/Logging.hs
Reorder init_logging arguments one last time.
[dead/htsn-common.git] / src / Network / Services / TSN / Logging.hs
index f4cf072e1f8f504c792a6e3ef330c8d69cfceb41..4a588e84c3ee6a7b24d3ba1b264a750048b1e323 100644 (file)
@@ -1,4 +1,4 @@
--- | Provide convenience functions for logging to the HSLogger "root"
+-- | Provide convenience functions for logging to the HSLogger \"root\"
 --   logger.
 module Network.Services.TSN.Logging (
   init_logging,
@@ -29,39 +29,39 @@ import System.Log.Logger (
   warningM )
 
 
--- | Log a message at the DEBUG level.
+-- | Log a message at the 'DEBUG' level.
 log_debug :: String -> IO ()
 log_debug = debugM rootLoggerName
 
--- | Log a message at the ERROR level.
+-- | Log a message at the 'ERROR' level.
 log_error :: String -> IO ()
 log_error = errorM rootLoggerName
 
--- | Log a message at the INFO level.
+-- | Log a message at the 'INFO' level.
 log_info :: String -> IO ()
 log_info = infoM rootLoggerName
 
--- | Log a message at the WARNING level.
+-- | Log a message at the 'WARNING' level.
 log_warning :: String -> IO ()
 log_warning = warningM rootLoggerName
 
 
--- | 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@ arguments.
+-- | 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@ arguments.
 --
 --   If @syslog@ is 'False' and @log_file@ is 'Nothing'; then nothing
 --   will be logged and the @log_level@ will essentially be ignored
 --   (even though the root logger will have its level set).
 --
-init_logging :: Maybe FilePath -- ^ Path to the log file (optional)
-             -> Bool           -- ^ Log to syslog?
-             -> Priority       -- ^ The priority at and above which
+init_logging :: Priority       -- ^ The priority at and above which
                                --   to log messages.
+             -> Maybe FilePath -- ^ Path to the log file (optional)
+             -> Bool           -- ^ Log to syslog?
              -> IO ()
-init_logging log_file syslog log_level = do
+init_logging log_level log_file syslog = do
   -- First set the global log level and clear the default handler.
   let no_handlers = [] :: [GenericHandler a]
   updateGlobalLogger rootLoggerName (setLevel log_level .