Browse Source

Logging

pull/109/merge
Jure Šorn 1 year ago
parent
commit
8867e051d3
2 changed files with 4 additions and 4 deletions
  1. 4
      README.md
  2. 4
      index.html

4
README.md

@ -2478,9 +2478,9 @@ logging.basicConfig(
<Formatter> = logging.Formatter('<format>') # Creates a Formatter.
<Handler> = logging.FileHandler(<path>) # Creates a Handler.
<Handler>.setFormatter(<Formatter>) # Adds Formatter to the Handler.
<Handler>.setLevel(<str/int>) # Processes all messages by default.
<Handler>.setLevel(<int/str>) # Processes all messages by default.
<Logger>.addHandler(<Handler>) # Adds Handler to the Logger.
<Logger>.setLevel(<str/int>) # What is sent to handlers and parents.
<Logger>.setLevel(<int/str>) # What is sent to handlers and parent.
```
* **Parent logger can be specified by naming the child logger `'<parent>.<name>'`.**
* **Formatter also supports: pathname, filename, funcName, lineno, thread and process.**

4
index.html

@ -2032,9 +2032,9 @@ logging.debug/info/warning/error/critical(&lt;str&gt;) <span class="hljs-commen
<pre><code class="python language-python hljs">&lt;Formatter&gt; = logging.Formatter(<span class="hljs-string">'&lt;format&gt;'</span>) <span class="hljs-comment"># Creates a Formatter.</span>
&lt;Handler&gt; = logging.FileHandler(&lt;path&gt;) <span class="hljs-comment"># Creates a Handler.</span>
&lt;Handler&gt;.setFormatter(&lt;Formatter&gt;) <span class="hljs-comment"># Adds Formatter to the Handler.</span>
&lt;Handler&gt;.setLevel(&lt;str/int&gt;) <span class="hljs-comment"># Processes all messages by default. </span>
&lt;Handler&gt;.setLevel(&lt;int/str&gt;) <span class="hljs-comment"># Processes all messages by default.</span>
&lt;Logger&gt;.addHandler(&lt;Handler&gt;) <span class="hljs-comment"># Adds Handler to the Logger.</span>
&lt;Logger&gt;.setLevel(&lt;str/int&gt;) <span class="hljs-comment"># What is sent to handlers and parents.</span>
&lt;Logger&gt;.setLevel(&lt;int/str&gt;) <span class="hljs-comment"># What is sent to handlers and parent.</span>
</code></pre>
<ul>
<li><strong>Parent logger can be specified by naming the child logger <code class="python hljs"><span class="hljs-string">'&lt;parent&gt;.&lt;name&gt;'</span></code>.</strong></li>

Loading…
Cancel
Save