Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>UPDATE:</strong></p> <p>While logging is safe to use in multithreading environment:</p> <blockquote> <p>The logging module is intended to be thread-safe without any special work needing to be done by its clients. It achieves this though using threading locks; there is one lock to serialize access to the module’s shared data, and each handler also creates a lock to serialize access to its underlying I/O.</p> </blockquote> <p><a href="http://docs.python.org/2/library/logging.html#thread-safety" rel="nofollow">http://docs.python.org/2/library/logging.html#thread-safety</a></p> <p>it appears to be risky in multiprocessing environment since it doesn't protect the logging file with file locks (all it uses for protection is a bunch of mutexes). See the <a href="http://hg.python.org/cpython/file/d489394a73de/Lib/logging/__init__.py#l1000" rel="nofollow">source code</a> of FileHandler class (used by WatchedFileHandler). To guaranty writes atomicity you'll have to protect your log file with file locks yourself or you can use something like <a href="https://pypi.python.org/pypi/ConcurrentLogHandler/0.9.1" rel="nofollow">ConcurrentLogHandler</a></p> <p>So you was just lucky enough to avoid data overlaps in your log file. Usually operating systems don't provide any guaranties about writes atomicity, moreover different versions of libc may have different default values of buffer size.</p> <p>You can get default stream buffer size on your system using the following C code</p> <pre class="lang-c prettyprint-override"><code>#include &lt;stdio.h&gt; int main(void) { printf("%d\n", BUFSIZ); return 0; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload