Merge "Add some documentation on enabling logging"
Jenkins authored 8 years ago
Gerrit Code Review committed 8 years ago
0 | ======== | |
0 | ===== | |
1 | 1 | Usage |
2 | ======== | |
2 | ===== | |
3 | 3 | |
4 | 4 | This document describes some of the common usage patterns for Castellan. When |
5 | 5 | incorporating this package into your applications, care should be taken to |
163 | 163 | options.set_defaults(cfg.CONF, api_class='some.other.KeyManager') |
164 | 164 | manager = key_manager.API() |
165 | 165 | |
166 | Logging from within Castellan | |
167 | ----------------------------- | |
168 | ||
169 | Castellan uses ``oslo_log`` for logging. Log information will be generated | |
170 | if your application has configured the ``oslo_log`` module. If your | |
171 | application does not use ``oslo_log`` then you can enable default logging | |
172 | using ``enable_logging`` in the ``castellan.options`` module. | |
173 | ||
174 | **Example. Enabling default logging.** | |
175 | ||
176 | .. code:: python | |
177 | ||
178 | from castellan import options | |
179 | from castellan import key_manager | |
180 | ||
181 | options.enable_logging() | |
182 | manager = key_manager.API() | |
183 | ||
166 | 184 | Generating sample configuration files |
167 | 185 | ------------------------------------- |
168 | 186 |