diff --git a/extensions/_unitex.cpp b/extensions/_unitex.cpp index 01b2737f15688c39478a2346edb5652f07ac6946..c2e3cd2f423d9895c27b08292349cc7aec5022e3 100644 --- a/extensions/_unitex.cpp +++ b/extensions/_unitex.cpp @@ -162,7 +162,7 @@ This function unloads a dictionary from persistent space.\n\n\ Positional arguments (length: 1):\n\ 0 [str] -- the persistent file path returned by the\n\ 'load_persistent_dictionary' function.\n\n\ -Return [None]\ +Return [None].\ "; static PyObject *unitex_free_persistent_dictionary(PyObject *self, PyObject *args); @@ -182,7 +182,7 @@ This function unloads a grammar from persistent space.\n\n\ Positional arguments (length: 1):\n\ 0 [str] -- the persistent file path returned by the\n\ 'load_persistent_fst2' function.\n\n\ -Return [None]\ +Return [None].\ "; static PyObject *unitex_free_persistent_fst2(PyObject *self, PyObject *args); @@ -202,7 +202,7 @@ This function unloads an alphabet from persistent space.\n\n\ Positional arguments (length: 1):\n\ 0 [str] -- the persistent file path returned by the\n\ 'load_persistent_alphabet' function.\n\n\ -Return [None]\ +Return [None].\ "; static PyObject *unitex_free_persistent_alphabet(PyObject *self, PyObject *args); diff --git a/unitex/__init__.py b/unitex/__init__.py index 2d4f97a95ec2f30190fc336a777457242993e582..7c38fce7b8f7604071b1537cbaa8a8581e660dfd 100644 --- a/unitex/__init__.py +++ b/unitex/__init__.py @@ -179,6 +179,35 @@ def disable_stderr(): def init_log_system(verbose, debug, log=None): + """ + This function enables/disables the logging system. + + Arguments: + verbose [int] -- enables/disables the standard output. Possible + values are: + - 0: the standard output is disabled; + - 1: the standard output shows 'warnings' emitted by the + bindings logging system. + - 2: the standard output shows 'warnings' and various + processing informations emitted by the bindings logging + system; + - 3: the full standard output is activated for both the + bindings and the Unitex processor. + + debug [int] -- enables/disables the error output. Possible + values are: + - 0: the error output is disabled; + - 1: the error output is limited to the logging system + implemented in the bindings; + - 2: the error output is activated for both the bindings + and the Unitex processor. + + log [str] -- if not None, the error and standard outputs are + redirected to the file specified by this argument. Be sure + to have write access to this file. + + Return [None]. + """ for handler in logging.root.handlers[:]: logging.root.removeHandler(handler) kwargs = {}