ocaml-opentelemetry/opentelemetry/Opentelemetry/Self_debug/index.html
2026-04-09 13:25:27 +00:00

2 lines
5.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Self_debug (opentelemetry.Opentelemetry.Self_debug)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 3.1.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../../index.html">Index</a> &#x00BB; <a href="../../index.html">opentelemetry</a> &#x00BB; <a href="../index.html">Opentelemetry</a> &#x00BB; Self_debug</nav><header class="odoc-preamble"><h1>Module <code><span>Opentelemetry.Self_debug</span></code></h1><p>Emergency diagnostic logger for the OpenTelemetry SDK itself.</p><p>Bypasses the OTEL pipeline entirely. Defaults to silently discarding all messages. Use <a href="#val-to_stderr"><code>to_stderr</code></a> or set <a href="#val-logger"><code>logger</code></a> to enable output.</p><p>Usage:</p><pre class="language-ocaml"><code> Self_debug.log Info (fun () -&gt; Printf.sprintf &quot;batch flushed %d items&quot; n)</code></pre><p>.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.90</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-level"><a href="#type-level" class="anchor"></a><code><span><span class="keyword">type</span> level</span><span> = </span></code><ol><li id="type-level.Debug" class="def variant constructor anchored"><a href="#type-level.Debug" class="anchor"></a><code><span>| </span><span><span class="constructor">Debug</span></span></code></li><li id="type-level.Info" class="def variant constructor anchored"><a href="#type-level.Info" class="anchor"></a><code><span>| </span><span><span class="constructor">Info</span></span></code></li><li id="type-level.Warning" class="def variant constructor anchored"><a href="#type-level.Warning" class="anchor"></a><code><span>| </span><span><span class="constructor">Warning</span></span></code></li><li id="type-level.Error" class="def variant constructor anchored"><a href="#type-level.Error" class="anchor"></a><code><span>| </span><span><span class="constructor">Error</span></span></code></li></ol></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-logger"><a href="#type-logger" class="anchor"></a><code><span><span class="keyword">type</span> logger</span><span> = <span><a href="#type-level">level</a> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span>unit <span class="arrow">&#45;&gt;</span></span> string)</span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>A logger, takes a level and a (lazy) message, and maybe emit the message</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-logger"><a href="#val-logger" class="anchor"></a><code><span><span class="keyword">val</span> logger : <span><a href="#type-logger">logger</a> <a href="../../../ocaml/Stdlib/index.html#type-ref">ref</a></span></span></code></div><div class="spec-doc"><p>The current log sink. Replace to redirect output. Default: no-op.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-string_of_level"><a href="#val-string_of_level" class="anchor"></a><code><span><span class="keyword">val</span> string_of_level : <span><a href="#type-level">level</a> <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p>String representation of a level.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-level_above"><a href="#val-level_above" class="anchor"></a><code><span><span class="keyword">val</span> level_above : <span><span class="label">min_level</span>:<a href="#type-level">level</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-level">level</a> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div><div class="spec-doc"><p><code>level_above ~min_level lvl</code> is true if messages at level <code>lvl</code> should be logged.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> NEXT_RELEASE</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-log"><a href="#val-log" class="anchor"></a><code><span><span class="keyword">val</span> log : <span><a href="#type-level">level</a> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span>unit <span class="arrow">&#45;&gt;</span></span> string)</span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p><code>log level mk_msg</code> emits a diagnostic message if the current logger is active. <code>mk_msg</code> is called lazily — only if the message will be emitted.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-to_stderr"><a href="#val-to_stderr" class="anchor"></a><code><span><span class="keyword">val</span> to_stderr : <span><span class="optlabel">?min_level</span>:<a href="#type-level">level</a> <span class="arrow">&#45;&gt;</span></span> <span>unit <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Install a stderr logger. Messages below <code>min_level</code> (default: <code>Warning</code>) are suppressed. This is useful to help debug problems with this library itself (e.g. when nothing is emitted but the user expects something to be emitted)</p></div></div></div></body></html>