Browse Source

Logging

pull/152/head
Jure Šorn 2 years ago
parent
commit
1e05e2891e
2 changed files with 6 additions and 6 deletions
  1. 6
      README.md
  2. 6
      index.html

6
README.md

@ -2456,9 +2456,9 @@ import logging
```python
logging.basicConfig(filename=<path>) # Configures the root logger.
logging.debug/info/warning/error/critical(<str>) # Logs to the root logger.
<Logger> = logging.getLogger(__name__) # Creates a logger named after the module.
<Logger>.<level>(<str>) # All messages propagate to the root logger.
<Logger>.exception(<str>) # Appends caught exception and calls error().
<Logger> = logging.getLogger(__name__) # Logger named after the module.
<Logger>.<level>(<str>) # Messages propagate to the root logger.
<Logger>.exception(<str>) # Calls error() with caught exception.
```
### Setup

6
index.html

@ -2014,9 +2014,9 @@ print(table)
<pre><code class="python language-python hljs">logging.basicConfig(filename=&lt;path&gt;) <span class="hljs-comment"># Configures the root logger.</span>
logging.debug/info/warning/error/critical(&lt;str&gt;) <span class="hljs-comment"># Logs to the root logger.</span>
&lt;Logger&gt; = logging.getLogger(__name__) <span class="hljs-comment"># Creates a logger named after the module.</span>
&lt;Logger&gt;.&lt;level&gt;(&lt;str&gt;) <span class="hljs-comment"># All messages propagate to the root logger.</span>
&lt;Logger&gt;.exception(&lt;str&gt;) <span class="hljs-comment"># Appends caught exception and calls error().</span>
&lt;Logger&gt; = logging.getLogger(__name__) <span class="hljs-comment"># Logger named after the module.</span>
&lt;Logger&gt;.&lt;level&gt;(&lt;str&gt;) <span class="hljs-comment"># Messages propagate to the root logger.</span>
&lt;Logger&gt;.exception(&lt;str&gt;) <span class="hljs-comment"># Calls error() with caught exception.</span>
</code></pre>
<div><h3 id="setup">Setup</h3><pre><code class="python language-python hljs">logging.basicConfig(
filename=<span class="hljs-keyword">None</span>, <span class="hljs-comment"># Logs to console by default.</span>

|||||||
100:0
Loading…
Cancel
Save