-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | A fast logging system
--   
--   A fast logging system
@package fast-logger
@version 0.3.3

module System.Log.FastLogger.File

-- | The spec for logging files
data FileLogSpec
FileLogSpec :: String -> Integer -> Int -> FileLogSpec
log_file :: FileLogSpec -> String
log_file_size :: FileLogSpec -> Integer
log_backup_number :: FileLogSpec -> Int

-- | Checking if a log file can be written.
check :: FileLogSpec -> IO ()

-- | Rotating log files.
rotate :: FileLogSpec -> IO ()

module System.Log.FastLogger.Date

-- | A type for zoned date.
type ZonedDate = ByteString
zonedDateCacheConf :: DateCacheConf EpochTime


-- | Fast logging system to copy log data directly to Handle buffer.
module System.Log.FastLogger

-- | Abstract data type for logger.
data Logger

-- | Creates a <a>Logger</a> from the given handle.
--   (<a>ondemandDateCacher</a> <a>zonedDateCacheConf</a>) is used as a
--   Date getter.
mkLogger :: Bool -> Handle -> IO Logger

-- | Creates a <a>Logger</a> from the given handle.
mkLogger2 :: Bool -> Handle -> (DateCacheGetter, DateCacheCloser) -> IO Logger

-- | Creates a new <a>Logger</a> from old one by replacing <a>Handle</a>.
--   The new <a>Handle</a> automatically inherits the file mode of the old
--   one. The old <a>Handle</a> is automatically closed.
renewLogger :: Logger -> Handle -> IO Logger

-- | Destroy a <a>Logger</a> by closing internal <a>Handle</a>.
rmLogger :: Logger -> IO ()

-- | The <tt>hPut</tt> function to copy a list of <a>LogStr</a> to the
--   buffer of <a>Handle</a> of <a>Logger</a> directly.
loggerPutStr :: Logger -> [LogStr] -> IO ()

-- | The <tt>hPut</tt> function directory to copy <a>Builder</a> to the
--   buffer. The current implementation is inefficient at this moment. This
--   would replace <a>loggerPutStr</a> someday.
loggerPutBuilder :: Logger -> Builder -> IO ()

-- | Flushing the buffer of <a>Handle</a> of <a>Logger</a>.
loggerFlush :: Logger -> IO ()

-- | A date type to contain <a>String</a> and <a>ByteString</a>. This data
--   is exported so that format can be defined. This would be replaced with
--   <a>Builder</a> someday when it can be written directly to
--   <a>Handle</a> buffer.
data LogStr
LS :: !String -> LogStr
LB :: !ByteString -> LogStr
class ToLogStr a
toLogStr :: ToLogStr a => a -> LogStr

-- | Obtaining date string from <a>Logger</a>.
loggerDate :: Logger -> IO ZonedDate
instance ToLogStr Text
instance ToLogStr Text
instance ToLogStr ByteString
instance ToLogStr ByteString
instance ToLogStr [Char]
