logging-effect-extra (empty) → 1.0.0
raw patch · 8 files changed
+166/−0 lines, 8 filesdep +basedep +logging-effectdep +logging-effect-extrasetup-changed
Dependencies added: base, logging-effect, logging-effect-extra, logging-effect-extra-file, wl-pprint-text
Files
- CHANGELOG.md +5/−0
- LICENSE.md +23/−0
- README.md +18/−0
- Setup.hs +4/−0
- executable/log-extra.hs +24/−0
- library/Control/Monad/Log/Extra.hs +12/−0
- logging-effect-extra.cabal +48/−0
- package.yaml +32/−0
+ CHANGELOG.md view
@@ -0,0 +1,5 @@+# Change log++## 1.0.0++Initial release
+ LICENSE.md view
@@ -0,0 +1,23 @@+[The MIT License (MIT)][]++Copyright (c) 2017 Jason Shipman++Permission is hereby granted, free of charge, to any person obtaining a copy of+this software and associated documentation files (the "Software"), to deal in+the Software without restriction, including without limitation the rights to+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies+of the Software, and to permit persons to whom the Software is furnished to do+so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.++[The MIT License (MIT)]: https://opensource.org/licenses/MIT
+ README.md view
@@ -0,0 +1,18 @@+# [logging-effect-extra][]++## Synopsis++`logging-effect-extra` supplements [`logging-effect`][] with the following re-exported packages:++* `logging-effect-extra-file` - Convenient TH splices for adding file info to log messages++`logging-effect-extra` is a "batteries-included" package. Each of the packages above can be used independently or in any combination without depending on `logging-effect-extra`. For example, if Template Haskell is not acceptable for a project, users can depend on the other `logging-effect-extra-*` packages excluding `logging-effect-extra-file`.++This package has no clashing identifiers with [`logging-effect`][] and it re-exports the entirety of [`logging-effect`][], so users have full access to everything in [`logging-effect`][] and `logging-effect-extra` via the following single import:++```haskell+import Control.Monad.Log.Extra+```++[logging-effect-extra]: https://github.com/jship/logging-effect-extra+[`logging-effect`]: https://github.com/ocharles/logging-effect
+ Setup.hs view
@@ -0,0 +1,4 @@+import qualified Distribution.Simple++main :: IO ()+main = Distribution.Simple.defaultMain
+ executable/log-extra.hs view
@@ -0,0 +1,24 @@+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TemplateHaskell #-}++module Main (main) where++import Control.Monad.Log.Extra (Doc, WithFile, MonadLog, WithSeverity)+import qualified Control.Monad.Log.Extra as Log+import qualified System.IO as IO++app :: MonadLog (WithSeverity (WithFile Doc)) m => m ()+app = do+ $(Log.logEmergencyTH) "GAH! All systems are down!!!"+ $(Log.logAlertTH) "Red alert!"+ $(Log.logCriticalTH) "Critical hit!"+ $(Log.logErrorTH) "Errors abound!"+ $(Log.logWarningTH) "Cargo number 2331 has commandeered the vessel"+ $(Log.logNoticeTH) "Heads up, but it's no biggie."+ $(Log.logInformationalTH) "Does anyone read these?"+ $(Log.logDebugTH) "Sleuthing with log messages..."++main :: IO ()+main = Log.withFDHandler Log.defaultBatchingOptions IO.stdout 0.4 80 $ \stdoutHandler ->+ Log.runLoggingT app (stdoutHandler . Log.renderWithSeverity (Log.renderWithFile id))
+ library/Control/Monad/Log/Extra.hs view
@@ -0,0 +1,12 @@+module Control.Monad.Log.Extra+ ( -- * Batteries+ module Control.Monad.Log+ , module Control.Monad.Log.Extra.File++ -- * Re-exports+ , module Text.PrettyPrint.Leijen.Text+ ) where++import Control.Monad.Log+import Control.Monad.Log.Extra.File+import Text.PrettyPrint.Leijen.Text (Doc)
+ logging-effect-extra.cabal view
@@ -0,0 +1,48 @@+-- This file has been generated from package.yaml by hpack version 0.17.1.+--+-- see: https://github.com/sol/hpack++name: logging-effect-extra+version: 1.0.0+synopsis: Batteries-included `logging-effect`.+description: Batteries-included `logging-effect`.+category: Other+homepage: https://github.com/jship/logging-effect-extra#readme+bug-reports: https://github.com/jship/logging-effect-extra/issues+maintainer: Jason Shipman+license: MIT+build-type: Simple+cabal-version: >= 1.10++extra-source-files:+ CHANGELOG.md+ LICENSE.md+ package.yaml+ README.md++source-repository head+ type: git+ location: https://github.com/jship/logging-effect-extra++library+ hs-source-dirs:+ library+ ghc-options: -Wall+ build-depends:+ base >=4.8 && <4.11+ , logging-effect >= 1.1.0 && <1.3+ , logging-effect-extra-file >= 1.0.0 && < 1.1.0+ , wl-pprint-text >=1.1.0.4 && <1.2+ exposed-modules:+ Control.Monad.Log.Extra+ default-language: Haskell2010++executable log-extra+ main-is: log-extra.hs+ hs-source-dirs:+ executable+ ghc-options: -Wall -rtsopts -threaded -with-rtsopts=-N+ build-depends:+ base >=4.8 && <4.11+ , logging-effect-extra+ default-language: Haskell2010
+ package.yaml view
@@ -0,0 +1,32 @@+category: Other+dependencies:+- base >=4.8 && <4.11+description: Batteries-included `logging-effect`.+executables:+ log-extra:+ dependencies:+ - logging-effect-extra+ ghc-options:+ - -rtsopts+ - -threaded+ - -with-rtsopts=-N+ main: log-extra.hs+ source-dirs: executable+extra-source-files:+- CHANGELOG.md+- LICENSE.md+- package.yaml+- README.md+ghc-options: -Wall+github: jship/logging-effect-extra+library:+ dependencies:+ - logging-effect >= 1.1.0 && <1.3+ - logging-effect-extra-file >= 1.0.0 && < 1.1.0+ - wl-pprint-text >=1.1.0.4 && <1.2+ source-dirs: library+license: MIT+maintainer: Jason Shipman+name: logging-effect-extra+synopsis: Batteries-included `logging-effect`.+version: '1.0.0'