diff --git a/.headroom.yaml b/.headroom.yaml new file mode 100644 index 0000000..1c15a2c --- /dev/null +++ b/.headroom.yaml @@ -0,0 +1,33 @@ +## This is the configuration file for Headroom. +## See https://github.com/vaclavsvejcar/headroom for more details. +version: 0.4.0.0 + +run-mode: replace + +source-paths: + - src/ + +excluded-paths: [] + +template-paths: + - https://raw.githubusercontent.com/co-log/.github/chshersh/2-Headroom-template/headroom-templates/haskell.mustache + +variables: + author: Co-Log + email: xrom.xkov@gmail.com + _haskell_module_copyright: "(c) {{ _current_year }} {{ author }}" + +license-headers: + haskell: + put-after: ["^{-#"] + margin-bottom-code: 1 + margin-top-code: 1 + block-comment: + starts-with: ^{- \| + ends-with: (? , 2021 +## 0.3.0.0 — Oct 8, 2021 -* [#223](https://github.com/kowainik/co-log/pulls/223): +* [#223](https://github.com/co-log/co-log/pull/223): Support GHC-9.0.1. +* [#176](https://github.com/co-log/co-log/issues/176): + Add `logFlush` handle to flush the given + + __Breaking change:__ All `withLog*File` functions how flush handle + after logging each message. Now you'll see logs in the file + immediately. + + __Migration guide:__ If you rely on the previous behaviour, then + copy-paste corresponding functions and remove flushing. + +* Update maintainers information to the new Co-Log organization. ## 0.2.1.1 — Apr 18, 2020 diff --git a/co-log-core.cabal b/co-log-core.cabal index 481c906..281c81f 100644 --- a/co-log-core.cabal +++ b/co-log-core.cabal @@ -1,6 +1,6 @@ cabal-version: 2.4 name: co-log-core -version: 0.2.1.2 +version: 0.3.0.0 synopsis: Composable Contravariant Comonadic Logging Library description: This package provides core types and functions to work with the @LogAction@ data type which is both simple and powerful. @@ -27,7 +27,7 @@ license: MPL-2.0 license-file: LICENSE author: Dmitrii Kovanikov maintainer: Kowainik -copyright: 2018-2020 Kowainik +copyright: 2018-2020 Kowainik, 2021 Co-Log category: Logging, Contravariant, Comonad build-type: Simple stability: stable @@ -36,8 +36,8 @@ extra-doc-files: CHANGELOG.md tested-with: GHC == 8.2.2 GHC == 8.4.4 GHC == 8.6.5 - GHC == 8.8.3 - GHC == 8.10.1 + GHC == 8.8.4 + GHC == 8.10.7 GHC == 9.0.1 source-repository head diff --git a/src/Colog/Core.hs b/src/Colog/Core.hs index 7133b2c..449742b 100644 --- a/src/Colog/Core.hs +++ b/src/Colog/Core.hs @@ -1,7 +1,10 @@ {- | -Copyright: (c) 2018-2020 Kowainik -SPDX-License-Identifier: MPL-2.0 -Maintainer: Kowainik +Module : Colog.Core +Copyright : (c) 2018-2020 Kowainik, 2021 Co-Log +SPDX-License-Identifier : MPL-2.0 +Maintainer : Co-Log +Stability : Stable +Portability : Portable Exports all core functionality. @co-log-core@ is a lightweight package that defines only core data type and various combinators to work with it. @@ -25,6 +28,7 @@ The package has the following structure: * __"Colog.Core.IO":__ basic loggers that work with 'Control.Monad.IO.Class.MonadIO' and 'String'. * __"Colog.Core.Severity":__ logger severity. -} + module Colog.Core ( module Colog.Core.Action , module Colog.Core.Class diff --git a/src/Colog/Core/Action.hs b/src/Colog/Core/Action.hs index 269e744..753c81f 100644 --- a/src/Colog/Core/Action.hs +++ b/src/Colog/Core/Action.hs @@ -6,9 +6,12 @@ {-# LANGUAGE UndecidableInstances #-} {- | -Copyright: (c) 2018-2020 Kowainik -SPDX-License-Identifier: MPL-2.0 -Maintainer: Kowainik +Module : Colog.Core.Action +Copyright : (c) 2018-2020 Kowainik, 2021 Co-Log +SPDX-License-Identifier : MPL-2.0 +Maintainer : Co-Log +Stability : Stable +Portability : Portable Implements core data types and combinators for logging actions. -} diff --git a/src/Colog/Core/Class.hs b/src/Colog/Core/Class.hs index 684276b..fae61e1 100644 --- a/src/Colog/Core/Class.hs +++ b/src/Colog/Core/Class.hs @@ -3,9 +3,12 @@ {-# LANGUAGE Rank2Types #-} {- | -Copyright: (c) 2018-2020 Kowainik -SPDX-License-Identifier: MPL-2.0 -Maintainer: Kowainik +Module : Colog.Core.Class +Copyright : (c) 2018-2020 Kowainik, 2021 Co-Log +SPDX-License-Identifier : MPL-2.0 +Maintainer : Co-Log +Stability : Stable +Portability : Portable Provides type class for values that has access to 'LogAction'. -} diff --git a/src/Colog/Core/IO.hs b/src/Colog/Core/IO.hs index cf85a61..3f0c2c3 100644 --- a/src/Colog/Core/IO.hs +++ b/src/Colog/Core/IO.hs @@ -1,9 +1,12 @@ {-# LANGUAGE CPP #-} {- | -Copyright: (c) 2018-2020 Kowainik -SPDX-License-Identifier: MPL-2.0 -Maintainer: Kowainik +Module : Colog.Core.IO +Copyright : (c) 2018-2020 Kowainik +SPDX-License-Identifier : MPL-2.0 +Maintainer : Co-Log +Stability : Stable +Portability : Portable Introduces logging actions working in 'MonadIO'. These actions are very basic and inefficient because they use the 'String' data type. If you don't want to @@ -170,7 +173,7 @@ liftLogIO (LogAction action) = LogAction (liftIO . action) {- | This action can be used in combination with other actions to flush a handle every time you log anything. -@since x.x.x.x +@since 0.3.0.0 -} logFlush :: MonadIO m => Handle -> LogAction m a logFlush handle = LogAction $ const $ liftIO $ hFlush handle diff --git a/src/Colog/Core/Severity.hs b/src/Colog/Core/Severity.hs index 33b382a..bea964a 100644 --- a/src/Colog/Core/Severity.hs +++ b/src/Colog/Core/Severity.hs @@ -1,9 +1,12 @@ {-# LANGUAGE PatternSynonyms #-} {- | -Copyright: (c) 2018-2020 Kowainik -SPDX-License-Identifier: MPL-2.0 -Maintainer: Kowainik +Module : Colog.Core.Severity +Copyright : (c) 2018-2020 Kowainik, 2021 Co-Log +SPDX-License-Identifier : MPL-2.0 +Maintainer : Co-Log +Stability : Stable +Portability : Portable This module introduces 'Severity' data type for expressing how severe the message is. Also, it contains useful functions and patterns for work with 'Severity'.