@@ -41,46 +41,10 @@ OpenSemanticLab data model.
4141
4242## Logging
4343
44- osw reports what it is doing through the standard ` logging ` module, on the
45- ` osw ` logger, at INFO by default:
46-
47- ``` python
48- import osw
49-
50- osw.set_log_level(" WARNING" ) # see less
51- osw.set_log_level(" DEBUG" ) # see more
52- osw.disable_logging() # detach the handler osw attached
53- ```
54-
55- Set ` OSW_LOG_LEVEL ` to a level name, a level number, or ` OFF ` to choose the
56- level before the package is imported. ` OFF ` silences osw everywhere, including
57- in your own handlers.
58-
59- ### Collecting osw's records in your application
60-
61- Configure logging the way you normally would and osw's records arrive there,
62- once:
63-
64- ``` python
65- import logging
66- import osw
67-
68- logging.basicConfig(level = logging.INFO , filename = " app.log" )
69- ```
70-
71- The ` osw ` logger propagates at all times, so the records reach your handlers
72- whatever else happens. osw's own handler notices that something above it is
73- listening, detaches itself so nothing is written twice, and gives back the
74- level it had picked, so your level applies from then on. It makes no difference
75- whether you configure logging before or after importing osw.
76-
77- A level you asked for is kept across that hand-over, so ` set_log_level("DEBUG") `
78- or ` OSW_LOG_LEVEL=DEBUG ` is how you pull osw's debug records into an aggregated
79- setup while the rest of your application stays quieter.
80-
81- One case osw cannot detect is a handler added to the ` osw ` logger itself, since
82- that is indistinguishable from one of its own. Call ` disable_logging() ` first if
83- you do that.
44+ osw reports what it is doing on the ` osw ` logger at INFO by default. Levels,
45+ the ` OSW_LOG_LEVEL ` environment variable and how to collect the records in your
46+ own logging setup are described in the
47+ [ Get Started guide] ( https://opensemanticlab.github.io/osw-python/get-started/#logging ) .
8448
8549## Contributing
8650
0 commit comments