mirror of
https://github.com/ocaml-tracing/ocaml-trace.git
synced 2026-03-08 20:07:55 -04:00
restore enter_manual_{sub,toplevel}_span, but deprecated
this will ease migration
This commit is contained in:
parent
8f195adff9
commit
44fdc9557d
2 changed files with 35 additions and 0 deletions
|
|
@ -77,6 +77,16 @@ let[@inline] enter_manual_span ~parent ?flavor ?level ?__FUNCTION__ ~__FILE__
|
||||||
~__LINE__ ?data name
|
~__LINE__ ?data name
|
||||||
| _ -> Collector.dummy_explicit_span
|
| _ -> Collector.dummy_explicit_span
|
||||||
|
|
||||||
|
let[@inline] enter_manual_toplevel_span ?flavor ?level ?__FUNCTION__ ~__FILE__
|
||||||
|
~__LINE__ ?data name : explicit_span =
|
||||||
|
enter_manual_span ~parent:None ?flavor ?level ?__FUNCTION__ ~__FILE__
|
||||||
|
~__LINE__ ?data name
|
||||||
|
|
||||||
|
let[@inline] enter_manual_sub_span ~parent ?flavor ?level ?__FUNCTION__
|
||||||
|
~__FILE__ ~__LINE__ ?data name : explicit_span =
|
||||||
|
enter_manual_span ~parent:(Some parent) ?flavor ?level ?__FUNCTION__ ~__FILE__
|
||||||
|
~__LINE__ ?data name
|
||||||
|
|
||||||
let[@inline] exit_manual_span espan : unit =
|
let[@inline] exit_manual_span espan : unit =
|
||||||
if espan != Collector.dummy_explicit_span then (
|
if espan != Collector.dummy_explicit_span then (
|
||||||
match A.get collector with
|
match A.get collector with
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,31 @@ val enter_manual_span :
|
||||||
{!set_default_level}.
|
{!set_default_level}.
|
||||||
@since NEXT_RELEASE *)
|
@since NEXT_RELEASE *)
|
||||||
|
|
||||||
|
val enter_manual_sub_span :
|
||||||
|
parent:explicit_span_ctx ->
|
||||||
|
?flavor:[ `Sync | `Async ] ->
|
||||||
|
?level:Level.t ->
|
||||||
|
?__FUNCTION__:string ->
|
||||||
|
__FILE__:string ->
|
||||||
|
__LINE__:int ->
|
||||||
|
?data:(unit -> (string * user_data) list) ->
|
||||||
|
string ->
|
||||||
|
explicit_span
|
||||||
|
[@@deprecated "use enter_manual_span"]
|
||||||
|
(** @deprecated since NEXT_RELEASE, use {!enter_manual_span} *)
|
||||||
|
|
||||||
|
val enter_manual_toplevel_span :
|
||||||
|
?flavor:[ `Sync | `Async ] ->
|
||||||
|
?level:Level.t ->
|
||||||
|
?__FUNCTION__:string ->
|
||||||
|
__FILE__:string ->
|
||||||
|
__LINE__:int ->
|
||||||
|
?data:(unit -> (string * user_data) list) ->
|
||||||
|
string ->
|
||||||
|
explicit_span
|
||||||
|
[@@deprecated "use enter_manual_span"]
|
||||||
|
(** @deprecated since NEXT_RELEASE, use {!enter_manual_span} *)
|
||||||
|
|
||||||
val exit_manual_span : explicit_span -> unit
|
val exit_manual_span : explicit_span -> unit
|
||||||
(** Exit an explicit span. This can be on another thread, in a fiber or
|
(** Exit an explicit span. This can be on another thread, in a fiber or
|
||||||
lightweight thread, etc. and will be supported by backends nonetheless. The
|
lightweight thread, etc. and will be supported by backends nonetheless. The
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue