<commit_before>Frequently Asked Questions
==========================

.. contents:: Summary
   :backlinks: entry
   :local:

How to turn logging on/off?
---------------------------

Logging is turned off by default. In Java, simply call
``GatewayServer.turnLoggingOn()`` or ``GatewayServer.turnLoggingOff()``.
Py4J-java uses the ``java.util.logging`` framework. To get fined-grained
control over the logging behavior, just obtain a Logger instance by calling
``Logger.getLogger("py4j")``. You can also look at the `Java Logging Overview
<http://java.sun.com/javase/6/docs/technotes/guides/logging/overview.html>`_
for more information on this framework.
<commit_msg>cleanup. improved doc about logging<commit_after>Frequently Asked Questions
==========================

.. contents:: Summary
   :backlinks: entry
   :local:

How to turn logging on/off?
---------------------------

Logging is turned off by default. In Java, simply call
``GatewayServer.turnLoggingOn()`` or ``GatewayServer.turnLoggingOff()``.
Py4J-java uses the ``java.util.logging`` framework. To get fined-grained
control over the logging behavior, just obtain a Logger instance by calling
``Logger.getLogger("py4j")``. You can also look at the `Java Logging Overview
<http://java.sun.com/javase/6/docs/technotes/guides/logging/overview.html>`_
for more information on this framework.

For example, in Java, you can do:

.. code-block:: java
  
  GatewayServer.turnLoggingOn();
  logger = Logger.getLogger("py4j");
  logger.setLevel(Level.ALL);


{'fraction_non_alphanumeric': 0.17623762376237623, 'fraction_numerical': 0.0046204620462046205, 'mean_word_length': 4.087248322147651, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '758167', 'n_tokens_mistral': 444, 'n_tokens_neox': 430, 'n_words': 143}