Skip to content

Commit 066e6d5

Browse files
committed
Internal functions name changes.
1 parent 6fb7198 commit 066e6d5

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

co-log-json/src/Colog/Json/Action.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ encodeMessage Message{..} = Aeson.pairs $ mconcat fields where
9090
[ case namespace of
9191
Nothing -> mempty
9292
Just xs -> Aeson.pair "namespace" $ Aeson.lazyText xs
93-
, Aeson.pair "severity" $ commonSeverity message_severity
93+
, Aeson.pair "severity" $ encodeSeverity message_severity
9494
, Aeson.pair "thread" $ Aeson.int thread_id
9595
, case user_data of
9696
Nothing -> mempty

co-log-json/src/Colog/Json/Internal/Structured.hs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ module Colog.Json.Internal.Structured
3131
, Message(..)
3232
, LogStr(..)
3333
, PushContext(..)
34-
-- * Katip compatibility.
34+
-- * Internals.
3535
, Severity(..)
36-
, commonSeverity
36+
, encodeSeverity
3737
, showLS
3838
, ls
3939
, sl
@@ -52,7 +52,7 @@ import Foreign.C
5252
import GHC.Conc
5353
import GHC.Exts hiding (toList)
5454

55-
-- | Structured message.
55+
-- | Part of the structured message.
5656
data Structured
5757
= Segment T.Text -- ^ Part of the message that is associated this the context of code.
5858
| Attr T.Text Encoding -- ^ Add attribute to the list.
@@ -85,16 +85,16 @@ data Severity
8585
deriving (Show, Bounded, Eq, Ord, Enum)
8686

8787
-- | Convert severity into the one accepted by the loger.
88-
commonSeverity :: Severity -> Aeson.Encoding
89-
{-# INLINE commonSeverity #-}
90-
commonSeverity DebugS = Aeson.text "DEBUG"
91-
commonSeverity InfoS = Aeson.text "INFO"
92-
commonSeverity NoticeS = Aeson.text "NOTICE"
93-
commonSeverity WarningS = Aeson.text "WARNING"
94-
commonSeverity ErrorS = Aeson.text "ERROR"
95-
commonSeverity CriticalS = Aeson.text "CRITICAL"
96-
commonSeverity AlertS = Aeson.text "ALERT"
97-
commonSeverity EmergencyS = Aeson.text "EMERGENCY"
88+
encodeSeverity :: Severity -> Aeson.Encoding
89+
{-# INLINE encodeSeverity #-}
90+
encodeSeverity DebugS = Aeson.text "DEBUG"
91+
encodeSeverity InfoS = Aeson.text "INFO"
92+
encodeSeverity NoticeS = Aeson.text "NOTICE"
93+
encodeSeverity WarningS = Aeson.text "WARNING"
94+
encodeSeverity ErrorS = Aeson.text "ERROR"
95+
encodeSeverity CriticalS = Aeson.text "CRITICAL"
96+
encodeSeverity AlertS = Aeson.text "ALERT"
97+
encodeSeverity EmergencyS = Aeson.text "EMERGENCY"
9898

9999
-- | Wrapper over the structured message builder.
100100
newtype PushContext = PushContext (Seq Structured -> Seq Structured)
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
module Colog.Json.Message
2-
( PushContext(..)
2+
( -- * Message
3+
LogStr
34
, ls
5+
, showLS
6+
-- * Context
7+
, PushContext
48
, sl
59
) where
610

7-
811
import Colog.Json.Internal.Structured as Internal

0 commit comments

Comments
 (0)