-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | FFI interface to syslog(3) from POSIX.1-2001
--   
--   This library provides FFI bindings to syslog(3) from POSIX.1-2001. See
--   <a>http://www.opengroup.org/onlinepubs/009695399/basedefs/syslog.h.html</a>
--   for further details.
@package hsyslog
@version 1.6


-- | FFI bindings to Unix's <tt>syslog(3)</tt>. Process this file with
--   <tt>hsc2hs</tt> to obtain a Haskell module.
module System.Posix.Syslog

-- | Log messages are prioritized.
data Priority

-- | system is unusable
Emergency :: Priority

-- | action must be taken immediately
Alert :: Priority

-- | critical conditions
Critical :: Priority

-- | error conditions
Error :: Priority

-- | warning conditions
Warning :: Priority

-- | normal but significant condition
Notice :: Priority

-- | informational
Info :: Priority

-- | debug-level messages
Debug :: Priority

-- | Syslog distinguishes various system facilities. Most applications
--   should log in <a>USER</a>.
data Facility

-- | kernel messages
KERN :: Facility

-- | user-level messages (default unless set otherwise)
USER :: Facility

-- | mail system
MAIL :: Facility

-- | system daemons
DAEMON :: Facility

-- | security/authorization messages
AUTH :: Facility

-- | messages generated internally by syslogd
SYSLOG :: Facility

-- | line printer subsystem
LPR :: Facility

-- | network news subsystem
NEWS :: Facility

-- | UUCP subsystem
UUCP :: Facility

-- | clock daemon
CRON :: Facility

-- | security/authorization messages (effectively equals <a>AUTH</a> on
--   some systems)
AUTHPRIV :: Facility

-- | ftp daemon (effectively equals <a>DAEMON</a> on some systems)
FTP :: Facility

-- | reserved for local use
LOCAL0 :: Facility

-- | reserved for local use
LOCAL1 :: Facility

-- | reserved for local use
LOCAL2 :: Facility

-- | reserved for local use
LOCAL3 :: Facility

-- | reserved for local use
LOCAL4 :: Facility

-- | reserved for local use
LOCAL5 :: Facility

-- | reserved for local use
LOCAL6 :: Facility

-- | reserved for local use
LOCAL7 :: Facility

-- | Options for the syslog service. Set with <a>withSyslog</a>.
data Option

-- | log the pid with each message
PID :: Option

-- | log on the console if errors in sending
CONS :: Option

-- | delay open until first <tt>syslog()</tt> (default)
ODELAY :: Option

-- | don't delay open
NDELAY :: Option

-- | don't wait for console forks: DEPRECATED
NOWAIT :: Option

-- | log to <tt>stderr</tt> as well (might be a no-op on some systems)
PERROR :: Option

-- | Bracket an <a>IO</a> computation between calls to <a>_openlog</a> and
--   <a>_closelog</a>. Since these settings are for the <i>process</i>,
--   multiple calls to this function will, unfortunately, overwrite each
--   other.
--   
--   Example:
--   
--   <pre>
--   main = withSyslog "my-ident" [PID, PERROR] USER $ do
--            putStrLn "huhu"
--            syslog Debug "huhu"
--   </pre>
withSyslog :: String -> [Option] -> Facility -> IO a -> IO a

-- | Log a message with the given priority.
syslog :: Priority -> String -> IO ()

-- | <tt>useSyslog ident</tt> <tt>=</tt> <tt>withSyslog ident [PID, PERROR]
--   USER</tt>
useSyslog :: String -> IO a -> IO a

-- | Escape any occurances of '<tt>%</tt>' in a string, so that it is safe
--   to pass it to <a>_syslog</a>. The <a>syslog</a> wrapper does this
--   automatically.
safeMsg :: String -> String
_closelog :: IO ()
_openlog :: CString -> CInt -> CInt -> IO ()
_setlogmask :: CInt -> IO CInt
_syslog :: CInt -> CString -> IO ()
instance Eq Priority
instance Bounded Priority
instance Show Priority
instance Generic Priority
instance Eq Facility
instance Bounded Facility
instance Show Facility
instance Eq Option
instance Bounded Option
instance Show Option
instance Datatype D1Priority
instance Constructor C1_0Priority
instance Constructor C1_1Priority
instance Constructor C1_2Priority
instance Constructor C1_3Priority
instance Constructor C1_4Priority
instance Constructor C1_5Priority
instance Constructor C1_6Priority
instance Constructor C1_7Priority
instance Enum Option
instance Enum Facility
instance Enum Priority
