| Copyright | Will Thompson and Iñaki García Etxebarria |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
GI.GLib.Structs.LogField
Description
Structure representing a single field in a structured log entry. See
g_log_structured() for details.
Log fields may contain arbitrary values, including binary with embedded nul
bytes. If the field contains a string, the string must be UTF-8 encoded and
have a trailing nul byte. Otherwise, length must be set to a non-negative
value.
Since: 2.50
Synopsis
- newtype LogField = LogField (ManagedPtr LogField)
- newZeroLogField :: MonadIO m => m LogField
- clearLogFieldKey :: MonadIO m => LogField -> m ()
- getLogFieldKey :: MonadIO m => LogField -> m (Maybe Text)
- setLogFieldKey :: MonadIO m => LogField -> CString -> m ()
- getLogFieldLength :: MonadIO m => LogField -> m Int64
- setLogFieldLength :: MonadIO m => LogField -> Int64 -> m ()
- clearLogFieldValue :: MonadIO m => LogField -> m ()
- getLogFieldValue :: MonadIO m => LogField -> m (Ptr ())
- setLogFieldValue :: MonadIO m => LogField -> Ptr () -> m ()
Exported types
Memory-managed wrapper type.
Instances
| Eq LogField Source # | |
| BoxedPtr LogField Source # | |
Defined in GI.GLib.Structs.LogField | |
| CallocPtr LogField Source # | |
Defined in GI.GLib.Structs.LogField Methods boxedPtrCalloc :: IO (Ptr LogField) | |
| ManagedPtrNewtype LogField Source # | |
Defined in GI.GLib.Structs.LogField Methods toManagedPtr :: LogField -> ManagedPtr LogField | |
| tag ~ 'AttrSet => Constructible LogField tag Source # | |
Methods
Properties
key
field name (UTF-8 string)
clearLogFieldKey :: MonadIO m => LogField -> m () Source #
Set the value of the “key” field to Nothing.
When overloading is enabled, this is equivalent to
clear #key
getLogFieldKey :: MonadIO m => LogField -> m (Maybe Text) Source #
Get the value of the “key” field.
When overloading is enabled, this is equivalent to
get logField #key
setLogFieldKey :: MonadIO m => LogField -> CString -> m () Source #
Set the value of the “key” field.
When overloading is enabled, this is equivalent to
setlogField [ #key:=value ]
length
length of value, in bytes, or -1 if it is nul-terminated
getLogFieldLength :: MonadIO m => LogField -> m Int64 Source #
Get the value of the “length” field.
When overloading is enabled, this is equivalent to
get logField #length
setLogFieldLength :: MonadIO m => LogField -> Int64 -> m () Source #
Set the value of the “length” field.
When overloading is enabled, this is equivalent to
setlogField [ #length:=value ]
value
field value (arbitrary bytes)
clearLogFieldValue :: MonadIO m => LogField -> m () Source #
Set the value of the “value” field to Nothing.
When overloading is enabled, this is equivalent to
clear #value
getLogFieldValue :: MonadIO m => LogField -> m (Ptr ()) Source #
Get the value of the “value” field.
When overloading is enabled, this is equivalent to
get logField #value
setLogFieldValue :: MonadIO m => LogField -> Ptr () -> m () Source #
Set the value of the “value” field.
When overloading is enabled, this is equivalent to
setlogField [ #value:=value ]