Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
The contents of this module can change at any time without warning.
Synopsis
- type Buffer = Ptr Word8
- type BufSize = Int
- defaultBufSize :: BufSize
- getBuffer :: BufSize -> IO Buffer
- freeBuffer :: Buffer -> IO ()
- toBufIOWith :: Buffer -> BufSize -> (Buffer -> Int -> IO ()) -> Builder -> IO ()
- type FD = FD
- closeFD :: FD -> IO ()
- openFileFD :: FilePath -> IO FD
- getStderrFD :: IO FD
- getStdoutFD :: IO FD
- writeRawBufferPtr2FD :: IORef FD -> Ptr Word8 -> Int -> IO Int
- invalidFD :: FD
- isFDValid :: FD -> Bool
- data Builder
- data LogStr = LogStr !Int Builder
- logStrLength :: LogStr -> Int
- fromLogStr :: LogStr -> ByteString
- class ToLogStr msg where
- mempty :: Monoid a => a
- (<>) :: Semigroup a => a -> a -> a
- data SingleLogger
- newSingleLogger :: BufSize -> IORef FD -> IO SingleLogger
- data MultiLogger
- newMultiLogger :: Int -> BufSize -> IORef FD -> IO MultiLogger
- writeLogStr :: Buffer -> IORef FD -> LogStr -> IO ()
- writeBigLogStr :: IORef FD -> LogStr -> IO ()
- class Loggers a where
- stopLoggers :: a -> IO ()
- pushLog :: a -> LogStr -> IO ()
- flushAllLog :: a -> IO ()
- module System.Log.FastLogger.LoggerSet
Documentation
defaultBufSize :: BufSize Source #
The default buffer size (4,096 bytes).
freeBuffer :: Buffer -> IO () Source #
getStderrFD :: IO FD Source #
getStdoutFD :: IO FD Source #
Builder
s denote sequences of bytes.
They are Monoid
s where
mempty
is the zero-length sequence and
mappend
is concatenation, which runs in O(1).
Log message builder. Use (<>
) to append two LogStr in O(1).
fromLogStr :: LogStr -> ByteString Source #
Converting LogStr
to ByteString
.
class ToLogStr msg where Source #
Types that can be converted to a LogStr
. Instances for
types from the text
library use a UTF-8 encoding. Instances
for numerical types use a decimal encoding.
Instances
ToLogStr Int16 Source # | Since: 2.4.14 |
ToLogStr Int32 Source # | Since: 2.4.14 |
ToLogStr Int64 Source # | Since: 2.4.14 |
ToLogStr Int8 Source # | Since: 2.4.14 |
ToLogStr Word16 Source # | Since: 2.4.14 |
ToLogStr Word32 Source # | Since: 2.4.14 |
ToLogStr Word64 Source # | Since: 2.4.14 |
ToLogStr Word8 Source # | Since: 2.4.14 |
ToLogStr Builder Source # | |
ToLogStr ByteString Source # | |
Defined in System.Log.FastLogger.LogStr toLogStr :: ByteString -> LogStr Source # | |
ToLogStr ByteString Source # | |
Defined in System.Log.FastLogger.LogStr toLogStr :: ByteString -> LogStr Source # | |
ToLogStr ShortByteString Source # | |
Defined in System.Log.FastLogger.LogStr toLogStr :: ShortByteString -> LogStr Source # | |
ToLogStr LogStr Source # | |
ToLogStr Text Source # | |
ToLogStr Text Source # | |
ToLogStr String Source # | |
ToLogStr Integer Source # | Since: 2.4.14 |
ToLogStr Double Source # | Since: 2.4.14 |
ToLogStr Float Source # | Since: 2.4.14 |
ToLogStr Int Source # | Since: 2.4.14 |
ToLogStr Word Source # | Since: 2.4.14 |
(<>) :: Semigroup a => a -> a -> a infixr 6 #
An associative operation.
>>>
[1,2,3] <> [4,5,6]
[1,2,3,4,5,6]
data SingleLogger Source #
A non-scale but time-ordered logger.
Instances
Loggers SingleLogger Source # | |
Defined in System.Log.FastLogger.SingleLogger stopLoggers :: SingleLogger -> IO () Source # pushLog :: SingleLogger -> LogStr -> IO () Source # flushAllLog :: SingleLogger -> IO () Source # |
newSingleLogger :: BufSize -> IORef FD -> IO SingleLogger Source #
Creating SingleLogger
.
data MultiLogger Source #
A scale but non-time-ordered logger.
Instances
Loggers MultiLogger Source # | |
Defined in System.Log.FastLogger.MultiLogger stopLoggers :: MultiLogger -> IO () Source # pushLog :: MultiLogger -> LogStr -> IO () Source # flushAllLog :: MultiLogger -> IO () Source # |
newMultiLogger :: Int -> BufSize -> IORef FD -> IO MultiLogger Source #
Creating MultiLogger
.
The first argument is the number of the internal builders.
class Loggers a where Source #
A class for internal loggers.
stopLoggers :: a -> IO () Source #
pushLog :: a -> LogStr -> IO () Source #
flushAllLog :: a -> IO () Source #
Instances
Loggers MultiLogger Source # | |
Defined in System.Log.FastLogger.MultiLogger stopLoggers :: MultiLogger -> IO () Source # pushLog :: MultiLogger -> LogStr -> IO () Source # flushAllLog :: MultiLogger -> IO () Source # | |
Loggers SingleLogger Source # | |
Defined in System.Log.FastLogger.SingleLogger stopLoggers :: SingleLogger -> IO () Source # pushLog :: SingleLogger -> LogStr -> IO () Source # flushAllLog :: SingleLogger -> IO () Source # |