Portability | portable |
---|---|
Stability | stable |
Maintainer | pxqr.sta@gmail.com |
Safe Haskell | None |
The context contains the default values read from the udev config file, and is passed to all library operations.
- data UDev
- class UDevChild a where
- newUDev :: IO UDev
- withUDev :: (UDev -> IO a) -> IO a
- data Priority
- type Logger = UDev -> Priority -> BS.ByteString -> Int -> BS.ByteString -> BS.ByteString -> IO ()
- getLogPriority :: UDev -> IO Priority
- setLogPriority :: UDev -> Priority -> IO ()
- setLogger :: UDev -> Logger -> IO ()
- defaultLogger :: Logger
- getUserdata :: UDev -> IO a
- setUserdata :: UDev -> a -> IO ()
Context
Family of udev resources.
Create udev library context. This reads the udev configuration file, and fills in the default values.
Logging
Log message priority.
= UDev | |
-> Priority | message priority; |
-> BS.ByteString | position: file |
-> Int | position: line |
-> BS.ByteString | position: function |
-> BS.ByteString | message body |
-> IO () |
Logger function will called by udev on events.
getLogPriority :: UDev -> IO PrioritySource
The initial logging priority is read from the udev config file at startup.
setLogPriority :: UDev -> Priority -> IO ()Source
Set the current logging priority. The value controls which messages are logged.
setLogger :: UDev -> Logger -> IO ()Source
The built-in logging writes to stderr. It can be overridden by a custom function, to plug log messages into the users' logging functionality.
Default logger will just print %PRIO %FILE:%LINE:n%FN: %FORMAT
to stdout.
User data
getUserdata :: UDev -> IO aSource
Retrieve stored data pointer from library context. This might be useful to access from callbacks like a custom logging function.
setUserdata :: UDev -> a -> IO ()Source
Store custom userdata in the library context.