Guest User

Untitled

a guest
Dec 10th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.81 KB | None | 0 0
  1. diff --git a/fast-logger/System/Log/FastLogger.hs b/fast-logger/System/Log/FastLogger.hs
  2. index 6ecdbcf..8506fbc 100644
  3. --- a/fast-logger/System/Log/FastLogger.hs
  4. +++ b/fast-logger/System/Log/FastLogger.hs
  5. @@ -43,6 +43,8 @@ module System.Log.FastLogger (
  6. , module System.Log.FastLogger.Date
  7. -- * File rotation
  8. , module System.Log.FastLogger.File
  9. + -- * Types
  10. + , module System.Log.FastLogger.Types
  11. ) where
  12.  
  13. #if __GLASGOW_HASKELL__ < 709
  14. @@ -63,6 +65,7 @@ import System.Log.FastLogger.IORef
  15. import System.Log.FastLogger.LogStr
  16. import System.Log.FastLogger.Logger
  17. import System.Log.FastLogger.Date
  18. +import System.Log.FastLogger.Types
  19.  
  20. ----------------------------------------------------------------
  21.  
  22. diff --git a/fast-logger/System/Log/FastLogger/Date.hs b/fast-logger/System/Log/FastLogger/Date.hs
  23. index ceb6f5d..d9666d7 100644
  24. --- a/fast-logger/System/Log/FastLogger/Date.hs
  25. +++ b/fast-logger/System/Log/FastLogger/Date.hs
  26. @@ -4,18 +4,15 @@
  27. -- |
  28. -- Formatting time is slow.
  29. -- This package provides mechanisms to cache formatted date.
  30. -module System.Log.FastLogger.Date (
  31. - -- * Types
  32. - TimeFormat
  33. - , FormattedTime
  34. - -- * Date cacher
  35. - , newTimeCache
  36. +module System.Log.FastLogger.Date
  37. + ( -- * Date cacher
  38. + newTimeCache
  39. , simpleTimeFormat
  40. , simpleTimeFormat'
  41. ) where
  42.  
  43. import Control.AutoUpdate (mkAutoUpdate, defaultUpdateSettings, updateAction)
  44. -import Data.ByteString (ByteString)
  45. +import System.Log.FastLogger.Types (TimeFormat, FormattedTime)
  46. #if WINDOWS
  47. import qualified Data.ByteString.Char8 as BS
  48. import Data.Time (UTCTime, formatTime, getCurrentTime, utcToLocalZonedTime)
  49. @@ -31,12 +28,6 @@ import System.Posix (EpochTime, epochTime)
  50.  
  51. ----------------------------------------------------------------
  52.  
  53. --- | Type aliaes for date format and formatted date.
  54. -type FormattedTime = ByteString
  55. -type TimeFormat = ByteString
  56. -
  57. -----------------------------------------------------------------
  58. -
  59. #if WINDOWS
  60. -- | Get date using UTC.
  61. getTime :: IO UTCTime
  62. diff --git a/fast-logger/System/Log/FastLogger/File.hs b/fast-logger/System/Log/FastLogger/File.hs
  63. index 4952e3e..84b9587 100644
  64. --- a/fast-logger/System/Log/FastLogger/File.hs
  65. +++ b/fast-logger/System/Log/FastLogger/File.hs
  66. @@ -13,9 +13,7 @@ import Data.ByteString (ByteString)
  67. import Data.ByteString.Char8 (unpack)
  68. import System.Directory (doesFileExist, doesDirectoryExist, getPermissions, writable, renameFile)
  69. import System.FilePath (takeDirectory, dropFileName, takeFileName, (</>))
  70. -
  71. -type TimeFormat = ByteString -- redeclaration to allow for LANGUAGE Safe
  72. -type FormattedTime = ByteString -- redeclaration to allow for LANGUAGE Safe
  73. +import System.Log.FastLogger.Types (TimeFormat, FormattedTime)
  74.  
  75. -- | The spec for logging files
  76. data FileLogSpec = FileLogSpec {
  77. diff --git a/fast-logger/System/Log/FastLogger/Types.hs b/fast-logger/System/Log/FastLogger/Types.hs
  78. new file mode 100644
  79. index 0000000..682b7d0
  80. --- /dev/null
  81. +++ b/fast-logger/System/Log/FastLogger/Types.hs
  82. @@ -0,0 +1,13 @@
  83. +module System.Log.FastLogger.Types (
  84. + -- * Types
  85. + TimeFormat
  86. + , FormattedTime
  87. + ) where
  88. +
  89. +import Data.ByteString (ByteString)
  90. +
  91. +----------------------------------------------------------------
  92. +
  93. +-- | Type aliaes for date format and formatted date.
  94. +type FormattedTime = ByteString
  95. +type TimeFormat = ByteString
  96. diff --git a/fast-logger/fast-logger.cabal b/fast-logger/fast-logger.cabal
  97. index 40aa884..8646fd4 100644
  98. --- a/fast-logger/fast-logger.cabal
  99. +++ b/fast-logger/fast-logger.cabal
  100. @@ -17,6 +17,7 @@ Library
  101. Exposed-Modules: System.Log.FastLogger
  102. System.Log.FastLogger.File
  103. System.Log.FastLogger.Date
  104. + System.Log.FastLogger.Types
  105. Other-Modules: System.Log.FastLogger.IO
  106. System.Log.FastLogger.FileIO
  107. System.Log.FastLogger.IORef
Add Comment
Please, Sign In to add comment