This PR makes `#guard_msgs` to treat `trace` messages separate from `info`, `warning` and `error`. It also introduce the ability to say `#guard_msgs (pass info`, like `(drop info)` so far, and also adds `(check info)` as the explicit form of `(info)`, for completeness. Fixes #8266
35 lines
546 B
Text
35 lines
546 B
Text
import Lean.CoreM
|
|
import Lean.MonadEnv
|
|
|
|
open Lean
|
|
open Lean.Core
|
|
|
|
def f : CoreM Nat := do
|
|
let env ← getEnv;
|
|
let cinfo ← getConstInfo `Nat.add;
|
|
trace[Elab] "trace message";
|
|
IO.println $ toString cinfo.type;
|
|
IO.println "testing...";
|
|
pure 10;
|
|
|
|
/--
|
|
info: ([mdata borrowed:1 Nat]) -> ([mdata borrowed:1 Nat]) -> Nat
|
|
testing...
|
|
---
|
|
info: 10
|
|
-/
|
|
#guard_msgs in
|
|
#eval f
|
|
|
|
set_option trace.Elab true
|
|
|
|
/--
|
|
info: ([mdata borrowed:1 Nat]) -> ([mdata borrowed:1 Nat]) -> Nat
|
|
testing...
|
|
---
|
|
info: 10
|
|
---
|
|
trace: [Elab] trace message
|
|
-/
|
|
#guard_msgs in
|
|
#eval f
|