libZSamazonkaZSamazonka
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityprovisional
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.Logger

Description

Types and functions for constructing loggers and emitting log messages.

Synopsis

Constructing a Logger

type Logger = LogLevel -> ByteStringBuilder -> IO () #

A function threaded through various request and serialisation routines to log informational and debug messages.

newLogger :: MonadIO m => LogLevel -> Handle -> m Logger Source #

This is a primitive logger which can be used to log builds to a Handle.

Note: A more sophisticated logging library such as tinylog or fast-logger should be used in production code.

Levels

data LogLevel #

Constructors

Info

Info messages supplied by the user - this level is not emitted by the library.

Error

Error messages only.

Debug

Useful debug information + info + error levels.

Trace

Includes potentially sensitive signing metadata, and non-streaming response bodies.

Instances

Instances details
Enum LogLevel 
Instance details

Defined in Amazonka.Types

Eq LogLevel 
Instance details

Defined in Amazonka.Types

Ord LogLevel 
Instance details

Defined in Amazonka.Types

Show LogLevel 
Instance details

Defined in Amazonka.Types

Generic LogLevel 
Instance details

Defined in Amazonka.Types

Associated Types

type Rep LogLevel :: Type -> Type #

Methods

from :: LogLevel -> Rep LogLevel x #

to :: Rep LogLevel x -> LogLevel #

ToByteString LogLevel 
Instance details

Defined in Amazonka.Types

Methods

toBS :: LogLevel -> ByteString #

FromText LogLevel 
Instance details

Defined in Amazonka.Types

ToText LogLevel 
Instance details

Defined in Amazonka.Types

Methods

toText :: LogLevel -> Text #

type Rep LogLevel 
Instance details

Defined in Amazonka.Types

type Rep LogLevel = D1 ('MetaData "LogLevel" "Amazonka.Types" "libZSamazonka-coreZSamazonka-core" 'False) ((C1 ('MetaCons "Info" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Error" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Debug" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Trace" 'PrefixI 'False) (U1 :: Type -> Type)))

logError :: (MonadIO m, ToLog a) => Logger -> a -> m () Source #

logInfo :: (MonadIO m, ToLog a) => Logger -> a -> m () Source #

logDebug :: (MonadIO m, ToLog a) => Logger -> a -> m () Source #

logTrace :: (MonadIO m, ToLog a) => Logger -> a -> m () Source #

Building Messages

class ToLog a where #

Methods

build :: a -> ByteStringBuilder #

Convert a value to a loggable builder.

Instances

Instances details
ToLog Bool 
Instance details

Defined in Amazonka.Data.Log

ToLog Char 
Instance details

Defined in Amazonka.Data.Log

ToLog Double 
Instance details

Defined in Amazonka.Data.Log

ToLog Float 
Instance details

Defined in Amazonka.Data.Log

ToLog Int 
Instance details

Defined in Amazonka.Data.Log

ToLog Int8 
Instance details

Defined in Amazonka.Data.Log

ToLog Int16 
Instance details

Defined in Amazonka.Data.Log

ToLog Int32 
Instance details

Defined in Amazonka.Data.Log

ToLog Int64 
Instance details

Defined in Amazonka.Data.Log

ToLog Integer 
Instance details

Defined in Amazonka.Data.Log

ToLog Word 
Instance details

Defined in Amazonka.Data.Log

ToLog Word8 
Instance details

Defined in Amazonka.Data.Log

ToLog Word16 
Instance details

Defined in Amazonka.Data.Log

ToLog Word32 
Instance details

Defined in Amazonka.Data.Log

ToLog Word64 
Instance details

Defined in Amazonka.Data.Log

ToLog ByteString 
Instance details

Defined in Amazonka.Data.Log

ToLog Text 
Instance details

Defined in Amazonka.Data.Log

ToLog UTCTime 
Instance details

Defined in Amazonka.Data.Log

ToLog HttpVersion 
Instance details

Defined in Amazonka.Data.Log

ToLog Status 
Instance details

Defined in Amazonka.Data.Log

ToLog StdMethod 
Instance details

Defined in Amazonka.Data.Log

ToLog HttpException 
Instance details

Defined in Amazonka.Data.Log

ToLog HttpExceptionContent 
Instance details

Defined in Amazonka.Data.Log

ToLog RequestBody 
Instance details

Defined in Amazonka.Data.Log

ToLog Request 
Instance details

Defined in Amazonka.Data.Log

ToLog Accept 
Instance details

Defined in Amazonka.Waiter

ToLog Abbrev 
Instance details

Defined in Amazonka.Types

ToLog ErrorCode 
Instance details

Defined in Amazonka.Types

ToLog ErrorMessage 
Instance details

Defined in Amazonka.Types

ToLog RequestId 
Instance details

Defined in Amazonka.Types

ToLog Error 
Instance details

Defined in Amazonka.Types

ToLog SerializeError 
Instance details

Defined in Amazonka.Types

ToLog ServiceError 
Instance details

Defined in Amazonka.Types

ToLog Meta 
Instance details

Defined in Amazonka.Types

ToLog AccessKey 
Instance details

Defined in Amazonka.Types

ToLog AuthEnv 
Instance details

Defined in Amazonka.Types

ToLog Auth 
Instance details

Defined in Amazonka.Types

ToLog Region 
Instance details

Defined in Amazonka.Types

ToLog Seconds 
Instance details

Defined in Amazonka.Types

ToLog ChunkSize 
Instance details

Defined in Amazonka.Data.Body

ToLog EscapedPath 
Instance details

Defined in Amazonka.Data.Log

ToLog QueryString 
Instance details

Defined in Amazonka.Data.Log

ToLog TextLazy 
Instance details

Defined in Amazonka.Data.Log

ToLog ByteStringLazy 
Instance details

Defined in Amazonka.Data.Log

ToLog ByteStringBuilder 
Instance details

Defined in Amazonka.Data.Log

ToLog AuthError Source # 
Instance details

Defined in Amazonka.Auth

ToLog Credentials Source # 
Instance details

Defined in Amazonka.Auth

ToLog [Char] 
Instance details

Defined in Amazonka.Data.Log

Methods

build :: [Char] -> ByteStringBuilder #

ToLog [Header] 
Instance details

Defined in Amazonka.Data.Log

ToLog a => ToLog (Maybe a) 
Instance details

Defined in Amazonka.Data.Log

ToLog a => ToLog (CI a) 
Instance details

Defined in Amazonka.Data.Log

Methods

build :: CI a -> ByteStringBuilder #

ToLog (Response a) 
Instance details

Defined in Amazonka.Data.Log

ToLog (Sensitive a) 
Instance details

Defined in Amazonka.Data.Sensitive

buildLines :: [ByteStringBuilder] -> ByteStringBuilder #

Intercalate a list of ByteStringBuilders with newlines.