Skip to content

Commit 0f25910

Browse files
authored
New logging priority for telemetry events (#181)
1 parent e9d862e commit 0f25910

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Development/IDE/Types/Logger.hs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
module Development.IDE.Types.Logger
99
( Priority(..)
1010
, Logger(..)
11-
, logError, logWarning, logInfo, logDebug
11+
, logError, logWarning, logInfo, logDebug, logTelemetry
1212
, noLogging
1313
) where
1414

@@ -18,7 +18,8 @@ import qualified Data.Text as T
1818
data Priority
1919
-- Don't change the ordering of this type or you will mess up the Ord
2020
-- instance
21-
= Debug -- ^ Verbose debug logging.
21+
= Telemetry -- ^ Events that are useful for gathering user metrics.
22+
| Debug -- ^ Verbose debug logging.
2223
| Info -- ^ Useful information in case an error has to be understood.
2324
| Warning
2425
-- ^ These error messages should not occur in a expected usage, and
@@ -45,6 +46,9 @@ logInfo x = logPriority x Info
4546
logDebug :: Logger -> T.Text -> IO ()
4647
logDebug x = logPriority x Debug
4748

49+
logTelemetry :: Logger -> T.Text -> IO ()
50+
logTelemetry x = logPriority x Telemetry
51+
4852

4953
noLogging :: Logger
5054
noLogging = Logger $ \_ _ -> return ()

0 commit comments

Comments
 (0)