Logging doc
Author: sgugger
Pull request: yes

Adds documentation for the new centralized logger.


Comments:
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/6852?src=pr&el=h1) Report
> Merging [#6852](https://codecov.io/gh/huggingface/transformers/pull/6852?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/02d09c8fcc6bda2c345c84cec53289abbe7532ac?el=desc) will **increase** coverage by `1.00%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/6852/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/6852?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master    #6852      +/-   ##
==========================================
+ Coverage   79.01%   80.01%   +1.00%     
==========================================
  Files         157      157              
  Lines       28739    28739              
==========================================
+ Hits        22707    22995     +288     
+ Misses       6032     5744     -288     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/6852?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/utils/logging.py](https://codecov.io/gh/huggingface/transformers/pull/6852/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy91dGlscy9sb2dnaW5nLnB5) | `75.00% <ø> (ø)` | |
| [src/transformers/configuration\_bart.py](https://codecov.io/gh/huggingface/transformers/pull/6852/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9jb25maWd1cmF0aW9uX2JhcnQucHk=) | `90.00% <0.00%> (-4.00%)` | :arrow_down: |
| [src/transformers/file\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/6852/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9maWxlX3V0aWxzLnB5) | `82.41% <0.00%> (-0.26%)` | :arrow_down: |
| [src/transformers/modeling\_bart.py](https://codecov.io/gh/huggingface/transformers/pull/6852/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19iYXJ0LnB5) | `95.40% <0.00%> (-0.18%)` | :arrow_down: |
| [src/transformers/data/datasets/glue.py](https://codecov.io/gh/huggingface/transformers/pull/6852/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9kYXRhL2RhdGFzZXRzL2dsdWUucHk=) | `86.56% <0.00%> (+2.98%)` | :arrow_up: |
| [src/transformers/trainer\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/6852/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90cmFpbmVyX3V0aWxzLnB5) | `84.44% <0.00%> (+20.00%)` | :arrow_up: |
| [src/transformers/training\_args.py](https://codecov.io/gh/huggingface/transformers/pull/6852/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90cmFpbmluZ19hcmdzLnB5) | `91.66% <0.00%> (+25.00%)` | :arrow_up: |
| [src/transformers/trainer.py](https://codecov.io/gh/huggingface/transformers/pull/6852/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90cmFpbmVyLnB5) | `53.23% <0.00%> (+40.12%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/6852?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/6852?src=pr&el=footer). Last update [02d09c8...e45ca17](https://codecov.io/gh/huggingface/transformers/pull/6852?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


How do we get `transformers.logging.*`? There is either `transformers.utils.logging.*` or `logging.*` if the latter was imported.

Unrelated, also has the default just changed from INFO to WARN? I rebased my copy and noticed this change. Ah, yes, it was https://github.com/huggingface/transformers/commit/4561f05c5fafc2b636a2fc1d0dded9057d439745

You get `transformerts.logging.*` after doing `import transformers`. logging is imported in the project init, so there is no need to add the .utils.

Ah, I see - the test I was working on was doing `from transformers import logging`. If we follow this in docs it leads to a shorter:

`logging.set_verbosity(logging.INFO)`

and it matches the actual `logging.INFO` from the logging package.

.... but then `from transformers import logging` makes it hard to do `import logging`... same `logging` name. So then:

```
import transformers
transformers.logging.set_verbosity(transformers.logging.INFO)`
```
while being quite verbose, has no collision with the normal `logging` package

Thank you for expanding the docs, @sgugger - this is awesome!

Note that you have the shortcut
```
transformers.logging.set_verbosity_info()
```
but yes, importing logging directly will create a conflict with the logging module.

You meant `transformers.logging.set_verbosity_{info|warning|...}` (must be a typo in `login` :)

Yes, this is good!

Oops, fixed my comment.