-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | FFI interface to syslog(3) from POSIX.1-2001. -- -- FFI interface to syslog(3) from POSIX.1-2001. @package hsyslog @version 1.3 -- | FFI bindings to Unix's syslog(3). Process this file with -- hsc2hs 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 USER. 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 AUTH on -- some systems) AUTHPRIV :: Facility -- | ftp daemon (effectively equals DAEMON 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 withSyslog. data Option -- | log the pid with each message PID :: Option -- | log on the console if errors in sending CONS :: Option -- | delay open until first syslog() (default) ODELAY :: Option -- | don't delay open NDELAY :: Option -- | don't wait for console forks: DEPRECATED NOWAIT :: Option -- | log to stderr as well (might be a no-op on some systems) PERROR :: Option -- | Bracket an IO computation between calls to _openlog and -- _closelog. Since these settings are for the process, -- multiple calls to this function will, unfortunately, overwrite each -- other. -- -- Example: -- --
-- main = withSyslog "my-ident" [PID, PERROR] USER $ do -- putStrLn "huhu" -- syslog Debug "huhu" --withSyslog :: String -> [Option] -> Facility -> IO a -> IO a -- | Log a message with the given priority. syslog :: Priority -> String -> IO () -- | useSyslog ident = withSyslog ident [PID, PERROR] -- USER useSyslog :: String -> IO a -> IO a -- | Escape any occurances of '%' in a string, so that it is safe -- to pass it to _syslog. The syslog wrapper does this -- automatically. safeMsg :: String -> String _closelog :: IO () _openlog :: CString -> CInt -> CInt -> IO () _setlogmask :: CInt -> IO CInt _syslog :: CInt -> CString -> IO () instance Eq Option instance Bounded Option instance Show Option instance Eq Facility instance Bounded Facility instance Show Facility instance Eq Priority instance Bounded Priority instance Show Priority instance Enum Option instance Enum Facility instance Enum Priority