gi-glib-2.0.17: GLib bindings

Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com)
Safe Haskell | None
Language | Haskell2010

GI.GLib.Structs.LogField

Contents

- Exported types
- Properties
  - key
  - length
  - value

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
- noLogField :: Maybe 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

newtype LogField Source #

Memory-managed wrapper type.

Constructors

LogField (ManagedPtr LogField) |

Instances

WrappedPtr LogField Source # |
Instance details Defined in GI.GLib.Structs.LogField Methods wrappedPtrCalloc :: IO (Ptr LogField) Source # wrappedPtrCopy :: LogField -> IO LogField Source # wrappedPtrFree :: Maybe (FunPtr (Ptr LogField -> IO ())) Source #
tag ~ AttrSet => Constructible LogField tag Source # |
Instance details Defined in GI.GLib.Structs.LogField Methods new :: MonadIO m => (ManagedPtr LogField -> LogField) -> [AttrOp LogField tag] -> m LogField Source #

newZeroLogField :: MonadIO m => m LogField Source #

Construct a `LogField` struct initialized to zero.

noLogField :: Maybe LogField Source #

A convenience alias for `Nothing` :: `Maybe` `LogField`.

# 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

    set logField [ #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

    set logField [ #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

    set logField [ #value := value ]