amazonka-2.0: Comprehensive Amazon Web Services SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityprovisional
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.Logger

Description

Types and functions for constructing loggers and emitting log messages.

Synopsis

Constructing a Logger

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

A logging function called by various default hooks 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 Source #

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
ToByteString LogLevel Source # 
Instance details

Defined in Amazonka.Logger

Methods

toBS :: LogLevel -> ByteString #

FromText LogLevel Source # 
Instance details

Defined in Amazonka.Logger

ToText LogLevel Source # 
Instance details

Defined in Amazonka.Logger

Methods

toText :: LogLevel -> Text #

Enum LogLevel Source # 
Instance details

Defined in Amazonka.Logger

Generic LogLevel Source # 
Instance details

Defined in Amazonka.Logger

Associated Types

type Rep LogLevel :: Type -> Type #

Methods

from :: LogLevel -> Rep LogLevel x #

to :: Rep LogLevel x -> LogLevel #

Show LogLevel Source # 
Instance details

Defined in Amazonka.Logger

Eq LogLevel Source # 
Instance details

Defined in Amazonka.Logger

Ord LogLevel Source # 
Instance details

Defined in Amazonka.Logger

type Rep LogLevel Source # 
Instance details

Defined in Amazonka.Logger

type Rep LogLevel = D1 ('MetaData "LogLevel" "Amazonka.Logger" "amazonka-2.0-48plDWnPMAk3PGO79vdSa0" '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 AuthError Source # 
Instance details

Defined in Amazonka.Auth.Exception

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 ByteStringBuilder 
Instance details

Defined in Amazonka.Data.Log

ToLog ByteStringLazy 
Instance details

Defined in Amazonka.Data.Log

ToLog TextLazy 
Instance details

Defined in Amazonka.Data.Log

ToLog Abbrev 
Instance details

Defined in Amazonka.Types

ToLog AccessKey 
Instance details

Defined in Amazonka.Types

ToLog Auth 
Instance details

Defined in Amazonka.Types

ToLog AuthEnv 
Instance details

Defined in Amazonka.Types

ToLog Error 
Instance details

Defined in Amazonka.Types

ToLog ErrorCode 
Instance details

Defined in Amazonka.Types

ToLog ErrorMessage 
Instance details

Defined in Amazonka.Types

ToLog Meta 
Instance details

Defined in Amazonka.Types

ToLog Region 
Instance details

Defined in Amazonka.Types

ToLog RequestId 
Instance details

Defined in Amazonka.Types

ToLog Seconds 
Instance details

Defined in Amazonka.Types

ToLog SerializeError 
Instance details

Defined in Amazonka.Types

ToLog ServiceError 
Instance details

Defined in Amazonka.Types

ToLog Accept 
Instance details

Defined in Amazonka.Waiter

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 Int8 
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 Word8 
Instance details

Defined in Amazonka.Data.Log

ToLog ByteString 
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 Request 
Instance details

Defined in Amazonka.Data.Log

ToLog RequestBody 
Instance details

Defined in Amazonka.Data.Log

ToLog StdMethod 
Instance details

Defined in Amazonka.Data.Log

ToLog Status 
Instance details

Defined in Amazonka.Data.Log

ToLog HttpVersion 
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 Integer 
Instance details

Defined in Amazonka.Data.Log

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 Word 
Instance details

Defined in Amazonka.Data.Log

ToLog (Sensitive a) 
Instance details

Defined in Amazonka.Data.Sensitive

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 a => ToLog (Maybe a) 
Instance details

Defined in Amazonka.Data.Log

ToLog [Header] 
Instance details

Defined in Amazonka.Data.Log

ToLog [Char] 
Instance details

Defined in Amazonka.Data.Log

Methods

build :: [Char] -> ByteStringBuilder #

buildLines :: [ByteStringBuilder] -> ByteStringBuilder #

Intercalate a list of ByteStringBuilders with newlines.