Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
caisar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
caisar
Commits
d4ab0cd9
Commit
d4ab0cd9
authored
1 year ago
by
Julien Girard-Satabin
Committed by
Michele Alberti
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
[tests] CLI for log categories (option 2 without custom formatter)
parent
a1bc92f0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/logging.ml
+1
-29
1 addition, 29 deletions
src/logging.ml
src/verification.ml
+1
-1
1 addition, 1 deletion
src/verification.ml
with
2 additions
and
30 deletions
src/logging.ml
+
1
−
29
View file @
d4ab0cd9
...
@@ -53,34 +53,6 @@ let pp_header =
...
@@ -53,34 +53,6 @@ let pp_header =
|
Logs
.
Debug
->
|
Logs
.
Debug
->
pp_h
ppf
debug_style
(
match
h
with
None
->
"DEBUG"
|
Some
h
->
h
)
pp_h
ppf
debug_style
(
match
h
with
None
->
"DEBUG"
|
Some
h
->
h
)
let
reporter
ppf
=
let
report
_src
level
~
over
k
msgf
=
let
k
_
=
over
()
;
k
()
in
let
filter_tag
(
h
:
string
option
)
(
tags
:
Logs
.
Tag
.
set
option
)
k
ppf
fmt
=
let
has_spec_tag
=
match
tags
with
|
None
->
false
|
Some
tags
->
Logs
.
Tag
.
mem
spec_tag_def
tags
in
if
has_spec_tag
then
(* TODO: prepend the SPEC tag to each new line of
* fmt? *)
Caml
.(
Format
.
kfprintf
k
ppf
(
"%a[%s]
\n
@["
^^
fmt
^^
"@]@."
)
pp_header
(
level
,
h
)
"SPEC"
)
else
Caml
.(
Format
.
kfprintf
k
ppf
(
"%a@["
^^
fmt
^^
"@]@."
)
pp_header
(
level
,
h
))
in
msgf
@@
fun
?
header
?
tags
fmt
->
filter_tag
header
tags
k
ppf
fmt
in
{
Logs
.
report
}
let
specification_enabled
=
ref
false
let
specification_enabled
=
ref
false
let
setup_log
level
category
=
let
setup_log
level
category
=
...
@@ -91,4 +63,4 @@ let setup_log level category =
...
@@ -91,4 +63,4 @@ let setup_log level category =
|
Some
Category
.
Specification
->
specification_enabled
:=
true
|
Some
Category
.
Specification
->
specification_enabled
:=
true
|
_
->
()
|
_
->
()
in
in
Logs
.
set_reporter
(
reporter
Format
.
std_formatter
)
Logs
.
set_reporter
(
Logs_fmt
.
reporter
~
pp_header
()
)
This diff is collapsed.
Click to expand it.
src/verification.ml
+
1
−
1
View file @
d4ab0cd9
...
@@ -165,7 +165,7 @@ let build_command config_prover ~nn_filename =
...
@@ -165,7 +165,7 @@ let build_command config_prover ~nn_filename =
let
log_prover_task
driver
task
=
let
log_prover_task
driver
task
=
let
print
fmt
task
=
ignore
(
Driver
.
print_task_prepared
driver
fmt
task
)
in
let
print
fmt
task
=
ignore
(
Driver
.
print_task_prepared
driver
fmt
task
)
in
Logs
.
info
(
fun
m
->
Logs
.
info
(
fun
m
->
m
~
tags
:
(
Logging
.
spec_tag
()
)
"
%a
"
print
task
)
m
~
tags
:
(
Logging
.
spec_tag
()
)
"
[SPEC]
\n
@[%a@]
"
print
task
)
let
call_prover_on_task
limit
config
command
driver
task
=
let
call_prover_on_task
limit
config
command
driver
task
=
if
!
Logging
.
specification_enabled
then
log_prover_task
driver
task
;
if
!
Logging
.
specification_enabled
then
log_prover_task
driver
task
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment