gi-glib-2.0.17: GLib bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.GLib.Structs.LogField

Contents

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

Exported types

newtype LogField Source #

Memory-managed wrapper type.

Constructors

LogField (ManagedPtr LogField) 

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 ]