<spanid="evennia-utils-logger"></span><h1>evennia.utils.logger<aclass="headerlink"href="#module-evennia.utils.logger"title="Permalink to this headline">¶</a></h1>
<p>Logging facilities</p>
<p>These are thin wrappers on top of Twisted’s logging facilities; logs
are all directed either to stdout (if Evennia is running in
interactive mode) or to $GAME_DIR/server/logs.</p>
<p>The log_file() function uses its own threading system to log to
arbitrary files in $GAME_DIR/server/logs.</p>
<p>Note: All logging functions have two aliases, log_type() and
log_typemsg(). This is for historical, back-compatible reasons.</p>
<dlclass="py function">
<dtid="evennia.utils.logger.log_info">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">log_info</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#log_info"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.log_info"title="Permalink to this definition">¶</a></dt>
<dd><p>Logs any generic debugging/informative info that should appear in the log.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong>– (string) The message to be logged.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.info">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">info</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.logger.info"title="Permalink to this definition">¶</a></dt>
<dd><p>Logs any generic debugging/informative info that should appear in the log.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong>– (string) The message to be logged.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.log_infomsg">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">log_infomsg</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.logger.log_infomsg"title="Permalink to this definition">¶</a></dt>
<dd><p>Logs any generic debugging/informative info that should appear in the log.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong>– (string) The message to be logged.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.log_msg">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">log_msg</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.logger.log_msg"title="Permalink to this definition">¶</a></dt>
<dd><p>Logs any generic debugging/informative info that should appear in the log.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong>– (string) The message to be logged.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.log_warn">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">log_warn</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#log_warn"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.log_warn"title="Permalink to this definition">¶</a></dt>
<dd><p>Logs warnings that aren’t critical but should be noted.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em>) – The message to be logged.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.warn">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">warn</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.logger.warn"title="Permalink to this definition">¶</a></dt>
<dd><p>Logs warnings that aren’t critical but should be noted.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em>) – The message to be logged.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.warning">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">warning</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.logger.warning"title="Permalink to this definition">¶</a></dt>
<dd><p>Logs warnings that aren’t critical but should be noted.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em>) – The message to be logged.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.log_warnmsg">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">log_warnmsg</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.logger.log_warnmsg"title="Permalink to this definition">¶</a></dt>
<dd><p>Logs warnings that aren’t critical but should be noted.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em>) – The message to be logged.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.log_err">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">log_err</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#log_err"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.log_err"title="Permalink to this definition">¶</a></dt>
<dd><p>Logs an error message to the server log.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em>) – The message to be logged.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.error">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">error</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.logger.error"title="Permalink to this definition">¶</a></dt>
<dd><p>Logs an error message to the server log.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em>) – The message to be logged.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.err">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">err</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.logger.err"title="Permalink to this definition">¶</a></dt>
<dd><p>Logs an error message to the server log.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em>) – The message to be logged.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.log_errmsg">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">log_errmsg</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.logger.log_errmsg"title="Permalink to this definition">¶</a></dt>
<dd><p>Logs an error message to the server log.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em>) – The message to be logged.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.log_trace">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">log_trace</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#log_trace"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.log_trace"title="Permalink to this definition">¶</a></dt>
<dd><p>Log a traceback to the log. This should be called from within an
exception.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em><em>, </em><em>optional</em>) – Adds an extra line with added info
at the end of the traceback in the log.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.log_tracemsg">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">log_tracemsg</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.logger.log_tracemsg"title="Permalink to this definition">¶</a></dt>
<dd><p>Log a traceback to the log. This should be called from within an
exception.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em><em>, </em><em>optional</em>) – Adds an extra line with added info
at the end of the traceback in the log.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.exception">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">exception</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.logger.exception"title="Permalink to this definition">¶</a></dt>
<dd><p>Log a traceback to the log. This should be called from within an
exception.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em><em>, </em><em>optional</em>) – Adds an extra line with added info
at the end of the traceback in the log.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.critical">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">critical</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.logger.critical"title="Permalink to this definition">¶</a></dt>
<dd><p>Log a traceback to the log. This should be called from within an
exception.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em><em>, </em><em>optional</em>) – Adds an extra line with added info
at the end of the traceback in the log.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.trace">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">trace</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.logger.trace"title="Permalink to this definition">¶</a></dt>
<dd><p>Log a traceback to the log. This should be called from within an
exception.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em><em>, </em><em>optional</em>) – Adds an extra line with added info
at the end of the traceback in the log.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.log_dep">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">log_dep</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#log_dep"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.log_dep"title="Permalink to this definition">¶</a></dt>
<dd><p>Prints a deprecation message.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em>) – The deprecation message to log.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.dep">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">dep</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.logger.dep"title="Permalink to this definition">¶</a></dt>
<dd><p>Prints a deprecation message.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em>) – The deprecation message to log.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.deprecated">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">deprecated</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.logger.deprecated"title="Permalink to this definition">¶</a></dt>
<dd><p>Prints a deprecation message.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em>) – The deprecation message to log.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.log_depmsg">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">log_depmsg</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.logger.log_depmsg"title="Permalink to this definition">¶</a></dt>
<dd><p>Prints a deprecation message.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em>) – The deprecation message to log.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.log_sec">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">log_sec</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#log_sec"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.log_sec"title="Permalink to this definition">¶</a></dt>
<dd><p>Prints a security-related message.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em>) – The security message to log.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.sec">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">sec</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.logger.sec"title="Permalink to this definition">¶</a></dt>
<dd><p>Prints a security-related message.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em>) – The security message to log.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.security">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">security</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.logger.security"title="Permalink to this definition">¶</a></dt>
<dd><p>Prints a security-related message.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em>) – The security message to log.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.log_secmsg">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">log_secmsg</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.logger.log_secmsg"title="Permalink to this definition">¶</a></dt>
<dd><p>Prints a security-related message.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em>) – The security message to log.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.log_server">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">log_server</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#log_server"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.log_server"title="Permalink to this definition">¶</a></dt>
<dd><p>This is for the Portal to log captured Server stdout messages (it’s
usually only used during startup, before Server log is open)</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em>) – The message to be logged.</p></li>
<li><p><strong>**kwargs</strong>– If given, The <strong>msg</strong> is parsed as a format string with <strong>{..}</strong>
formatting markers that should match the keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py class">
<dtid="evennia.utils.logger.GetLogObserver">
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">GetLogObserver</code><aclass="reference internal"href="../_modules/evennia/utils/logger.html#GetLogObserver"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.GetLogObserver"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">component_prefix</code><emclass="property"> = ''</em><aclass="headerlink"href="#evennia.utils.logger.GetLogObserver.component_prefix"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">format_log_event</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">event</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#GetLogObserver.format_log_event"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.GetLogObserver.format_log_event"title="Permalink to this definition">¶</a></dt>
<dd><p>By assigning log_system here, we skip the spammy display of namespace/level
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">GetPortalLogObserver</code><aclass="reference internal"href="../_modules/evennia/utils/logger.html#GetPortalLogObserver"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.GetPortalLogObserver"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">component_prefix</code><emclass="property"> = '|Portal| '</em><aclass="headerlink"href="#evennia.utils.logger.GetPortalLogObserver.component_prefix"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">GetServerLogObserver</code><aclass="reference internal"href="../_modules/evennia/utils/logger.html#GetServerLogObserver"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.GetServerLogObserver"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">component_prefix</code><emclass="property"> = ''</em><aclass="headerlink"href="#evennia.utils.logger.GetServerLogObserver.component_prefix"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.timeformat">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">timeformat</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">when</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#timeformat"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.timeformat"title="Permalink to this definition">¶</a></dt>
<dd><p>This helper function will format the current time in the same
way as the twisted logger does, including time zone info. Only
difference from official logger is that we only use two digits
for the year and don’t show timezone for GMT times.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>when</strong> (<em>int</em><em>, </em><em>optional</em>) – This is a time in POSIX seconds on the form
given by time.time(). If not given, this function will
use the current time.</p>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>timestring (str)</em>– A formatted string of the given time.</p>
</dd>
</dl>
</dd></dl>
<dlclass="py class">
<dtid="evennia.utils.logger.WeeklyLogFile">
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">WeeklyLogFile</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">name</span></em>, <emclass="sig-param"><spanclass="n">directory</span></em>, <emclass="sig-param"><spanclass="n">defaultMode</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">day_rotation</span><spanclass="o">=</span><spanclass="default_value">7</span></em>, <emclass="sig-param"><spanclass="n">max_size</span><spanclass="o">=</span><spanclass="default_value">1000000</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#WeeklyLogFile"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.WeeklyLogFile"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">__init__</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">name</span></em>, <emclass="sig-param"><spanclass="n">directory</span></em>, <emclass="sig-param"><spanclass="n">defaultMode</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">day_rotation</span><spanclass="o">=</span><spanclass="default_value">7</span></em>, <emclass="sig-param"><spanclass="n">max_size</span><spanclass="o">=</span><spanclass="default_value">1000000</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#WeeklyLogFile.__init__"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.WeeklyLogFile.__init__"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>name</strong> (<em>str</em>) – Name of log file.</p></li>
<li><p><strong>directory</strong> (<em>str</em>) – Directory holding the file.</p></li>
<li><p><strong>defaultMode</strong> (<em>str</em>) – Permissions used to create file. Defaults to
current permissions of this file if it exists.</p></li>
<li><p><strong>day_rotation</strong> (<em>int</em>) – How often to rotate the file.</p></li>
<li><p><strong>max_size</strong> (<em>int</em>) – Max size of log file before rotation (regardless of
<codeclass="sig-name descname">shouldRotate</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#WeeklyLogFile.shouldRotate"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.WeeklyLogFile.shouldRotate"title="Permalink to this definition">¶</a></dt>
<dd><p>Rotate when the date has changed since last write</p>
<codeclass="sig-name descname">suffix</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">tupledate</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#WeeklyLogFile.suffix"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.WeeklyLogFile.suffix"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the suffix given a (year, month, day) tuple or unixtime.
Format changed to have 03 for march instead of 3 etc (retaining unix
file order)</p>
<p>If we get duplicate suffixes in location (due to hitting size limit),
<codeclass="sig-name descname">rotate</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#WeeklyLogFile.rotate"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.WeeklyLogFile.rotate"title="Permalink to this definition">¶</a></dt>
<dd><p>Rotate the file and create a new one.</p>
<p>If it’s not possible to open new logfile, this will fail silently,
and continue logging to old logfile.</p>
</dd></dl>
<dlclass="py method">
<dtid="evennia.utils.logger.WeeklyLogFile.write">
<codeclass="sig-name descname">write</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">data</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#WeeklyLogFile.write"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.WeeklyLogFile.write"title="Permalink to this definition">¶</a></dt>
<dd><p>Write data to log file</p>
</dd></dl>
</dd></dl>
<dlclass="py class">
<dtid="evennia.utils.logger.EvenniaLogFile">
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">EvenniaLogFile</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">name</span></em>, <emclass="sig-param"><spanclass="n">directory</span></em>, <emclass="sig-param"><spanclass="n">rotateLength</span><spanclass="o">=</span><spanclass="default_value">1000000</span></em>, <emclass="sig-param"><spanclass="n">defaultMode</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">maxRotatedFiles</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#EvenniaLogFile"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.EvenniaLogFile"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">settings</code><emclass="property"> = <LazySettings "evennia.settings_default"></em><aclass="headerlink"href="#evennia.utils.logger.EvenniaLogFile.settings"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">num_lines_to_append</code><emclass="property"> = 20</em><aclass="headerlink"href="#evennia.utils.logger.EvenniaLogFile.num_lines_to_append"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">rotate</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">num_lines_to_append</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#EvenniaLogFile.rotate"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.EvenniaLogFile.rotate"title="Permalink to this definition">¶</a></dt>
<dd><p>Rotates our log file and appends some number of lines from
the previous log to the start of the new one.</p>
</dd></dl>
<dlclass="py method">
<dtid="evennia.utils.logger.EvenniaLogFile.seek">
<codeclass="sig-name descname">seek</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#EvenniaLogFile.seek"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.EvenniaLogFile.seek"title="Permalink to this definition">¶</a></dt>
<dd><p>Convenience method for accessing our _file attribute’s seek method,
which is used in tail_log_function.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>*args</strong>– Same args as file.seek</p></li>
<li><p><strong>**kwargs</strong>– Same kwargs as file.seek</p></li>
<codeclass="sig-name descname">readlines</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#EvenniaLogFile.readlines"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.EvenniaLogFile.readlines"title="Permalink to this definition">¶</a></dt>
<dd><p>Convenience method for accessing our _file attribute’s readlines method,
which is used in tail_log_function.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>*args</strong>– same args as file.readlines</p></li>
<li><p><strong>**kwargs</strong>– same kwargs as file.readlines</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>lines (list)</em>– lines from our _file attribute.</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.log_file">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">log_file</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em>, <emclass="sig-param"><spanclass="n">filename</span><spanclass="o">=</span><spanclass="default_value">'game.log'</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#log_file"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.log_file"title="Permalink to this definition">¶</a></dt>
<dd><p>Arbitrary file logger using threads.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>msg</strong> (<em>str</em>) – String to append to logfile.</p></li>
<li><p><strong>filename</strong> (<em>str</em><em>, </em><em>optional</em>) – Defaults to ‘game.log’. All logs
will appear in the logs directory and log entries will start
on new lines following datetime info.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.log_file_exists">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">log_file_exists</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">filename</span><spanclass="o">=</span><spanclass="default_value">'game.log'</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#log_file_exists"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.log_file_exists"title="Permalink to this definition">¶</a></dt>
<dd><p>Determine if a log-file already exists.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>filename</strong> (<em>str</em>) – The filename (within the log-dir).</p>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>bool</em>– If the log file exists or not.</p>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.logger.rotate_log_file">
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">rotate_log_file</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">filename</span><spanclass="o">=</span><spanclass="default_value">'game.log'</span></em>, <emclass="sig-param"><spanclass="n">num_lines_to_append</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#rotate_log_file"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.rotate_log_file"title="Permalink to this definition">¶</a></dt>
<dd><p>Force-rotate a log-file, without</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>filename</strong> (<em>str</em>) – The log file, located in settings.LOG_DIR.</p></li>
<li><p><strong>num_lines_to_append</strong> (<em>int</em><em>, </em><em>optional</em>) – Include N number of
lines from previous file in new one. If <strong>None</strong>, use default.
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">delete_log_file</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">filename</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#delete_log_file"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.delete_log_file"title="Permalink to this definition">¶</a></dt>
<dd><p>Delete a log file</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>filename</strong> (<em>str</em>) – The name of the log file, located in settings.LOG_DIR</p>
<codeclass="sig-prename descclassname">evennia.utils.logger.</code><codeclass="sig-name descname">tail_log_file</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">filename</span></em>, <emclass="sig-param"><spanclass="n">offset</span></em>, <emclass="sig-param"><spanclass="n">nlines</span></em>, <emclass="sig-param"><spanclass="n">callback</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/logger.html#tail_log_file"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.logger.tail_log_file"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the tail of the log file.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>filename</strong> (<em>str</em>) – The name of the log file, presumed to be in
the Evennia log dir.</p></li>
<li><p><strong>offset</strong> (<em>int</em>) – The line offset <em>from the end of the file</em> to start
reading from. 0 means to start at the latest entry.</p></li>
<li><p><strong>nlines</strong> (<em>int</em>) – How many lines to return, counting backwards
from the offset. If file is shorter, will get all lines.</p></li>
<li><p><strong>callback</strong> (<em>callable</em><em>, </em><em>optional</em>) – A function to manage the result of the
asynchronous file access. This will get a list of lines. If unset,
the tail will happen synchronously.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><p><em>lines (deferred or list)</em>–</p>
<dlclass="simple">
<dt>This will be a deferred if <strong>callable</strong> is given,</dt><dd><p>otherwise it will be a list with The nline entries from the end of the file, or