Skip to content

Commit fbc58af

Browse files
committed
Revert "Add oneLineJson to all log entries"
This reverts commit 339ec7a.
1 parent 0226aed commit fbc58af

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+24
-173
lines changed

kore/src/Kore/Equation/DebugEquation.hs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import Control.Error (
2828
ExceptT,
2929
withExceptT,
3030
)
31-
import Data.Aeson qualified as JSON
3231
import Data.Text (
3332
Text,
3433
)
@@ -60,7 +59,13 @@ import Kore.Rewrite.RewritingVariable (
6059
RewritingVariableName,
6160
)
6261
import Kore.Unparser (Unparse (..))
63-
import Log
62+
import Log (
63+
Entry (..),
64+
MonadLog,
65+
Severity (..),
66+
logEntry,
67+
logWhile,
68+
)
6469
import Prelude.Kore
6570
import Pretty (Pretty (..))
6671
import Pretty qualified
@@ -271,7 +276,6 @@ instance Entry DebugAttemptEquation where
271276
(srcLoc equation)
272277
oneLineDoc (DebugAttemptEquationResult _ (Left _)) = "equation is not applicable"
273278
oneLineDoc (DebugAttemptEquationResult _ (Right _)) = "equation is applicable"
274-
275279
oneLineJson = \case
276280
entry@DebugAttemptEquation{} -> JSON.object ["entry" JSON..= Log.entryTypeText (Log.toEntry entry)]
277281
DebugAttemptEquationResult equation (Right _) ->
@@ -363,8 +367,6 @@ instance Entry DebugApplyEquation where
363367
_
364368
) =
365369
pretty sourceLocation
366-
oneLineJson entry =
367-
JSON.object ["entry" JSON..= Log.entryTypeText (Log.toEntry entry)]
368370
helpDoc _ = "log equation application successes"
369371

370372
{- | Log when an 'Equation' is actually applied.

kore/src/Kore/Log/DebugAppliedRewriteRules.hs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ module Kore.Log.DebugAppliedRewriteRules (
1313
debugAppliedLabeledRewriteRule,
1414
) where
1515

16-
import Data.Aeson qualified as JSON
1716
import Data.Text (Text)
1817
import Kore.Attribute.Axiom (
1918
SourceLocation,
@@ -61,11 +60,8 @@ instance Pretty DebugAppliedRewriteRules where
6160
instance Entry DebugAppliedRewriteRules where
6261
entrySeverity _ = Debug
6362
helpDoc _ = "log applied rewrite rules"
64-
6563
oneLineDoc DebugAppliedRewriteRules{appliedRewriteRules} =
6664
Pretty.hsep $ pretty <$> appliedRewriteRules
67-
oneLineJson entry =
68-
JSON.object ["entry" JSON..= Log.entryTypeText (Log.toEntry entry)]
6965

7066
debugAppliedRewriteRules ::
7167
MonadLog log =>
@@ -110,8 +106,6 @@ instance Entry DebugAppliedLabeledRewriteRule where
110106
entrySeverity _ = Debug
111107
helpDoc _ = "log applied rewrite rule with label"
112108
oneLineDoc DebugAppliedLabeledRewriteRule{sourceLocation} = pretty sourceLocation
113-
oneLineJson entry =
114-
JSON.object ["entry" JSON..= Log.entryTypeText (Log.toEntry entry)]
115109

116110
debugAppliedLabeledRewriteRule ::
117111
MonadLog log =>

kore/src/Kore/Log/DebugAttemptUnification.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ module Kore.Log.DebugAttemptUnification (
1010
debugAttemptUnification,
1111
) where
1212

13-
import Data.Aeson qualified as JSON
1413
import GHC.Generics qualified as GHC
1514
import Generics.SOP qualified as SOP
1615
import Kore.Internal.TermLike (
@@ -39,8 +38,6 @@ instance Entry DebugAttemptUnification where
3938
entrySeverity _ = Debug
4039
contextDoc _ = Just "while attempting unification"
4140
oneLineDoc _ = "DebugAttemptUnification"
42-
oneLineJson entry =
43-
JSON.object ["entry" JSON..= Log.entryTypeText (Log.toEntry entry)]
4441
helpDoc _ = "log unification attempts"
4542

4643
instance Pretty DebugAttemptUnification where

kore/src/Kore/Log/DebugAttemptedRewriteRules.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ module Kore.Log.DebugAttemptedRewriteRules (
1111
debugAttemptedRewriteRule,
1212
) where
1313

14-
import Data.Aeson qualified as JSON
1514
import Data.Text (Text)
1615
import Kore.Attribute.Axiom (
1716
SourceLocation,
@@ -57,8 +56,6 @@ instance Pretty DebugAttemptedRewriteRules where
5756
instance Entry DebugAttemptedRewriteRules where
5857
entrySeverity _ = Debug
5958
helpDoc _ = "log attempted rewrite rules"
60-
oneLineJson entry =
61-
JSON.object ["entry" JSON..= Log.entryTypeText (Log.toEntry entry)]
6259
oneLineDoc DebugAttemptedRewriteRules{attemptedRewriteRule} =
6360
pretty attemptedRewriteRule
6461

kore/src/Kore/Log/DebugBeginClaim.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ module Kore.Log.DebugBeginClaim (
1010
debugBeginClaim,
1111
) where
1212

13-
import Data.Aeson qualified as JSON
1413
import Kore.Attribute.SourceLocation (
1514
SourceLocation,
1615
)
@@ -36,8 +35,6 @@ instance Entry DebugBeginClaim where
3635
helpDoc _ = "log starting claims"
3736
oneLineDoc DebugBeginClaim{claim} =
3837
pretty @SourceLocation $ from claim
39-
oneLineJson entry =
40-
JSON.object ["entry" JSON..= Log.entryTypeText (Log.toEntry entry)]
4138

4239
debugBeginClaim ::
4340
MonadLog log =>

kore/src/Kore/Log/DebugCreatedSubstitution.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ module Kore.Log.DebugCreatedSubstitution (
1010
debugCreatedSubstitution,
1111
) where
1212

13-
import Data.Aeson qualified as JSON
1413
import Kore.Internal.Predicate qualified as Predicate
1514
import Kore.Internal.Substitution (Substitution)
1615
import Kore.Internal.Substitution qualified as Substitution
@@ -48,8 +47,6 @@ instance Entry DebugCreatedSubstitution where
4847
. layoutPrettyUnbounded
4948
. Pretty.group
5049
. pretty
51-
oneLineJson entry =
52-
JSON.object ["entry" JSON..= Log.entryTypeText (Log.toEntry entry)]
5350
helpDoc _ = "log every substitution created when applying semantic rules"
5451

5552
debugCreatedSubstitution ::

kore/src/Kore/Log/DebugEvaluateCondition.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ module Kore.Log.DebugEvaluateCondition (
1111
debugEvaluateConditionResult,
1212
) where
1313

14-
import Data.Aeson qualified as JSON
1514
import GHC.Generics qualified as GHC
1615
import Generics.SOP qualified as SOP
1716
import Kore.Internal.Predicate (
@@ -62,8 +61,6 @@ instance Entry DebugEvaluateCondition where
6261
contextDoc _ = Just "while evaluating predicate"
6362
oneLineDoc (DebugEvaluateCondition _) = "DebugEvaluateCondition _"
6463
oneLineDoc result = pretty (show result)
65-
oneLineJson entry =
66-
JSON.object ["entry" JSON..= Log.entryTypeText (Log.toEntry entry)]
6764
helpDoc _ = "log every predicate evaluated by the SMT solver"
6865

6966
instance SQL.Table DebugEvaluateCondition

kore/src/Kore/Log/DebugProven.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ module Kore.Log.DebugProven (
99
DebugProven (..),
1010
) where
1111

12-
import Data.Aeson qualified as JSON
1312
import Kore.Attribute.SourceLocation (SourceLocation)
1413
import Kore.Reachability.SomeClaim (
1514
SomeClaim (..),
@@ -31,6 +30,4 @@ instance Pretty DebugProven where
3130
instance Entry DebugProven where
3231
entrySeverity _ = Debug
3332
oneLineDoc DebugProven{claim} = pretty @SourceLocation $ from claim
34-
oneLineJson entry =
35-
JSON.object ["entry" JSON..= Log.entryTypeText (Log.toEntry entry)]
3633
helpDoc _ = "log proven claims"

kore/src/Kore/Log/DebugRetrySolverQuery.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ module Kore.Log.DebugRetrySolverQuery (
1010
debugRetrySolverQuery,
1111
) where
1212

13-
import Data.Aeson qualified as JSON
1413
import Kore.Internal.Predicate (
1514
Predicate,
1615
)
@@ -49,8 +48,6 @@ instance Pretty DebugRetrySolverQuery where
4948
instance Entry DebugRetrySolverQuery where
5049
entrySeverity _ = Debug
5150
oneLineDoc _ = "DebugRetrySolverQuery"
52-
oneLineJson entry =
53-
JSON.object ["entry" JSON..= Log.entryTypeText (Log.toEntry entry)]
5451
helpDoc _ =
5552
"warning raised when the solver failed to decide\
5653
\ the satisfiability of a formula, indicating that\

kore/src/Kore/Log/DebugRewriteTrace.hs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ module Kore.Log.DebugRewriteTrace (
1717
rewriteTraceLogger,
1818
) where
1919

20-
import Data.Aeson qualified as JSON
2120
import Data.ByteString (
2221
ByteString,
2322
)
@@ -181,33 +180,21 @@ instance Pretty DebugRewriteTrace where
181180
instance Entry DebugInitialClaim where
182181
entrySeverity _ = Debug
183182
oneLineDoc (DebugInitialClaim uniqueId _) = "Initial claim " <> maybe mempty pretty (getUniqueId uniqueId)
184-
oneLineJson entry =
185-
JSON.object ["entry" JSON..= Log.entryTypeText (Log.toEntry entry)]
186-
187183
helpDoc _ = "log every claim before proving it"
188184

189185
instance Entry DebugInitialPattern where
190186
entrySeverity _ = Debug
191187
oneLineDoc (DebugInitialPattern _) = "Initial pattern"
192-
oneLineJson entry =
193-
JSON.object ["entry" JSON..= Log.entryTypeText (Log.toEntry entry)]
194-
195188
helpDoc _ = "log initial pattern before rewriting"
196189

197190
instance Entry DebugFinalPatterns where
198191
entrySeverity _ = Debug
199192
oneLineDoc (DebugFinalPatterns _) = "Final patterns"
200-
oneLineJson entry =
201-
JSON.object ["entry" JSON..= Log.entryTypeText (Log.toEntry entry)]
202-
203193
helpDoc _ = "log final patterns after rewriting"
204194

205195
instance Entry DebugRewriteTrace where
206196
entrySeverity _ = Debug
207197
oneLineDoc DebugRewriteTrace{} = "Rewrite trace"
208-
oneLineJson entry =
209-
JSON.object ["entry" JSON..= Log.entryTypeText (Log.toEntry entry)]
210-
211198
helpDoc _ = "log rewrite substitutions"
212199

213200
unparseOneLine :: Unparse p => p -> Text

kore/src/Kore/Log/DebugSolver.hs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ module Kore.Log.DebugSolver (
1616
solverTranscriptLogger,
1717
) where
1818

19-
import Data.Aeson qualified as JSON
2019
import Data.Default
2120
import Data.Text (
2221
Text,
@@ -28,9 +27,7 @@ import Log (
2827
LogAction (..),
2928
Severity (Debug),
3029
SomeEntry (..),
31-
entryTypeText,
3230
logWith,
33-
toEntry,
3431
)
3532
import Options.Applicative (
3633
Parser,
@@ -68,15 +65,11 @@ instance Pretty DebugSolverRecv where
6865
instance Entry DebugSolverSend where
6966
entrySeverity _ = Debug
7067
oneLineDoc _ = "DebugSolverSend"
71-
oneLineJson entry =
72-
JSON.object ["entry" JSON..= Log.entryTypeText (Log.toEntry entry)]
7368
helpDoc _ = "log commands sent to SMT solver"
7469

7570
instance Entry DebugSolverRecv where
7671
entrySeverity _ = Debug
7772
oneLineDoc _ = "DebugSolverRecv"
78-
oneLineJson entry =
79-
JSON.object ["entry" JSON..= Log.entryTypeText (Log.toEntry entry)]
8073
helpDoc _ = "log responses received from SMT solver"
8174

8275
logDebugSolverSendWith ::

kore/src/Kore/Log/DebugSubstitutionSimplifier.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ module Kore.Log.DebugSubstitutionSimplifier (
1111
debugSubstitutionSimplifierResult,
1212
) where
1313

14-
import Data.Aeson qualified as JSON
1514
import GHC.Generics qualified as GHC
1615
import Generics.SOP qualified as SOP
1716
import Log
@@ -39,8 +38,6 @@ instance Entry DebugSubstitutionSimplifier where
3938
entrySeverity _ = Debug
4039
contextDoc _ = Just "while simplifying substitution"
4140
oneLineDoc = pretty . show
42-
oneLineJson entry =
43-
JSON.object ["entry" JSON..= Log.entryTypeText (Log.toEntry entry)]
4441
helpDoc _ = "log non-\\bottom results when normalizing unification solutions"
4542

4643
instance SQL.Table DebugSubstitutionSimplifier

kore/src/Kore/Log/DebugTransition.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ module Kore.Log.DebugTransition (
1212
debugFinalTransition,
1313
) where
1414

15-
import Data.Aeson qualified as JSON
1615
import Kore.Attribute.SourceLocation (
1716
SourceLocation,
1817
)
@@ -110,8 +109,6 @@ instance Entry DebugTransition where
110109
oneLineDoc
111110
(DebugBeforeTransition BeforeTransition{transition}) =
112111
"before " <> pretty transition
113-
oneLineJson entry =
114-
JSON.object ["entry" JSON..= Log.entryTypeText (Log.toEntry entry)]
115112

116113
debugBeforeTransition ::
117114
MonadLog log =>

kore/src/Kore/Log/DebugUnification.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ module Kore.Log.DebugUnification (
1515
whileDebugUnification,
1616
) where
1717

18-
import Data.Aeson qualified as JSON
1918
import Kore.Internal.Pattern as Pattern
2019
import Kore.Internal.TermLike as TermLike
2120
import Kore.Unparser
@@ -42,8 +41,6 @@ instance Entry DebugUnification where
4241
oneLineDoc (DebugUnificationWhile _) = "DebugUnificationWhile"
4342
oneLineDoc (DebugUnificationSolved _) = "DebugUnificationSolved"
4443
oneLineDoc (DebugUnificationUnsolved _) = "DebugUnificationUnsolved"
45-
oneLineJson entry =
46-
JSON.object ["entry" JSON..= Log.entryTypeText (Log.toEntry entry)]
4744

4845
-- | @WhileDebugUnification@ encloses the context of unification log entries.
4946
data WhileDebugUnification = WhileDebugUnification {term1, term2 :: TermLike VariableName}

kore/src/Kore/Log/DebugUnifyBottom.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ module Kore.Log.DebugUnifyBottom (
1212
debugUnifyBottomAndReturnBottom,
1313
) where
1414

15-
import Data.Aeson qualified as JSON
1615
import Data.Text (
1716
Text,
1817
)
@@ -27,9 +26,7 @@ import Log (
2726
Entry (..),
2827
MonadLog (..),
2928
Severity (..),
30-
entryTypeText,
3129
logEntry,
32-
toEntry,
3330
)
3431
import Logic (
3532
MonadLogic,
@@ -62,8 +59,6 @@ instance Pretty DebugUnifyBottom where
6259
instance Entry DebugUnifyBottom where
6360
entrySeverity _ = Debug
6461
oneLineDoc _ = "DebugUnifyBottom"
65-
oneLineJson entry =
66-
JSON.object ["entry" JSON..= entryTypeText (toEntry entry)]
6762
helpDoc _ = "log failed unification"
6863

6964
mkDebugUnifyBottom ::

kore/src/Kore/Log/DecidePredicateUnknown.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import Control.Exception (
2020
Exception (..),
2121
throw,
2222
)
23-
import Data.Aeson qualified as JSON
2423
import Data.Text (Text)
2524
import Debug
2625
import Kore.Attribute.SourceLocation (
@@ -103,8 +102,6 @@ instance Entry DecidePredicateUnknown where
103102
prettyHsLoc Loc{loc_module, loc_start = (row, col)} =
104103
Pretty.pretty loc_module <> ":" <> Pretty.pretty row <> ":" <> Pretty.pretty col
105104
oneLineDoc _ = "DecidePredicateUnknown"
106-
oneLineJson entry =
107-
JSON.object ["entry" JSON..= Log.entryTypeText (Log.toEntry entry)]
108105
helpDoc _ =
109106
"error or a warning when the solver cannot decide the satisfiability of a formula"
110107

kore/src/Kore/Log/ErrorBottomTotalFunction.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import Pretty (
2828
)
2929
import Pretty qualified
3030
import SQL qualified
31-
import Data.Aeson qualified as JSON
3231

3332
newtype ErrorBottomTotalFunction = ErrorBottomTotalFunction
3433
{ term :: TermLike VariableName
@@ -56,8 +55,6 @@ instance Exception ErrorBottomTotalFunction where
5655
instance Entry ErrorBottomTotalFunction where
5756
entrySeverity _ = Error
5857
oneLineDoc _ = "ErrorBottomTotalFunction"
59-
oneLineJson entry =
60-
JSON.object ["entry" JSON..= Log.entryTypeText (Log.toEntry entry)]
6158
helpDoc _ = "errors raised when a total function is undefined"
6259

6360
instance SQL.Table ErrorBottomTotalFunction

0 commit comments

Comments
 (0)