<!-- Source: https://docs.squirro.com/en/latest/api/squirro.lib.nlp.steps.debuggers.LogFieldsDebugger.html -->
# LogFieldsDebugger

**`class LogFieldsDebugger(config)`**

Bases: [`Debugger`](squirro.lib.nlp.steps.debuggers.Debugger.md#squirro.lib.nlp.steps.debuggers.Debugger)

The field [`Debugger`](squirro.lib.nlp.steps.debuggers.Debugger.md#squirro.lib.nlp.steps.debuggers.Debugger) logs values of different fields of the [`Document`](../technical/libnlp/base.md#squirro.lib.nlp.document.Document) at different stages of the `Pipeline`. This is useful for debugging purposes.

Parameters

- `max_length` ([`int`](https://docs.python.org/3.11/library/functions.html#int)`, ``100`) – Maximum length of the logged value of a string type field. E.g (Can be used to limit the length of printed body)
- `log_level` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``"debug"`) – Debugging level one of [“debug”,”info”,”warning”]

**Example**

```json
{
    "step": "debugger",
    "type": "log_fields",
    "fields": ["body"],
    "log_level": "warning"
}
```

Methods SummaryMethods Documentation

**`process_doc(doc)`**

Process a document

Parameters

`doc` ([`Document`](../technical/libnlp/base.md#squirro.lib.nlp.document.Document)) – Document

Returns

Processed document

Return type

[Document](../technical/libnlp/base.md#squirro.lib.nlp.document.Document)

**`train(docs)`**

Train on a step of a set of documents

Parameters

`docs` (`generator``(`[`Document`](../technical/libnlp/base.md#squirro.lib.nlp.document.Document)`)`) – Generator of documents

Returns

Generator of processed documents

Return type

generator([Document](../technical/libnlp/base.md#squirro.lib.nlp.document.Document))
