packages feed

wai-logger 0.1.0 → 0.1.1

raw patch · 2 files changed

+23/−8 lines, 2 filesdep ~fast-loggerPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: fast-logger

API changes (from Hackage documentation)

Files

Network/Wai/Logger/Date.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE DoAndIfThenElse, BangPatterns #-}+{-# LANGUAGE CPP #-}  module Network.Wai.Logger.Date (     ZonedDate@@ -13,14 +14,21 @@ import Data.IORef import Data.Time import System.Locale+#if WINDOWS+#define TIME UTCTime+#define GETTIME getCurrentTime+#else import System.Posix (EpochTime, epochTime) import Data.Time.Clock.POSIX+#define TIME EpochTime+#define GETTIME epochTime+#endif  -- | A type for zoned date. type ZonedDate = ByteString  data DateCache = DateCache {-    unixTime :: !EpochTime+    unixTime :: !TIME   , zonedDate :: !ZonedDate   } @@ -30,7 +38,7 @@ -- | Getting 'ZonedDate' from the 'ZonedDate' cache. getDate :: DateRef -> IO ZonedDate getDate (DateRef ref) = do-    newEt <- epochTime+    newEt <- GETTIME     cache <- readIORef ref     let oldEt = unixTime cache     if oldEt == newEt then@@ -40,13 +48,17 @@         !_ <- atomicModifyIORef ref (\_ -> (newCache, ()))         return $ zonedDate newCache -newDate :: EpochTime -> IO DateCache+newDate :: TIME -> IO DateCache newDate et = DateCache et . format <$> toZonedTime et   where     toZonedTime = utcToLocalZonedTime . toUTC+#if WINDOWS+    toUTC = id+#else     toUTC = posixSecondsToUTCTime . realToFrac+#endif     format = BS.pack . formatTime defaultTimeLocale "%d/%b/%Y:%T %z"  -- | Initializing the 'ZonedDate' cache. dateInit :: IO DateRef-dateInit = DateRef <$> (epochTime >>= newDate >>= newIORef)+dateInit = DateRef <$> (GETTIME >>= newDate >>= newIORef)
wai-logger.cabal view
@@ -1,5 +1,5 @@ Name:                   wai-logger-Version:                0.1.0+Version:                0.1.1 Author:                 Kazu Yamamoto <kazu@iij.ad.jp> Maintainer:             Kazu Yamamoto <kazu@iij.ad.jp> License:                BSD3@@ -16,10 +16,13 @@                         Network.Wai.Logger.Format                         Network.Wai.Logger.Utils   Build-Depends:        base >= 4 && < 5, time, old-locale,-                        unix, bytestring, blaze-builder,+                        bytestring, blaze-builder,                         wai, fast-logger, http-types, case-insensitive,                         network, byteorder+  if os(windows)+    cpp-options: -DWINDOWS+  else+    build-depends: unix Source-Repository head   Type:                 git-  Location:             git://github.com/kazu-yamamoto/wai-logger.git-+  Location:             git://github.com/kazu-yamamoto/logger.git