Updated python docs to update logs
This commit is contained in:
parent
6267351df1
commit
06f2917eae
2 changed files with 30 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -185,5 +185,6 @@ release/
|
|||
|
||||
# Kompute
|
||||
swiftshader/
|
||||
vk_swiftshader_icd.json
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -313,5 +313,33 @@ Log Level Configuration
|
|||
|
||||
Logging inside the C++ uses the PyBind logging, which allows for all the std::cout to be passed to a python logger.
|
||||
|
||||
All python output is logged to the logger with the name `kp`.
|
||||
All python output is logged to the logger with the name `kp`. You can interact with the logger similar to any python logging as per the example below:
|
||||
|
||||
|
||||
.. code-block:: python
|
||||
:linenos:
|
||||
|
||||
>>> import kp
|
||||
>>> import logging
|
||||
>>>
|
||||
>>> kp_logger = logging.getLogger("kp")
|
||||
>>> kp_logger.setLevel(logging.INFO)
|
||||
>>>
|
||||
>>> kp.Manager()
|
||||
INFO:kp:Using physical device index {} found {}
|
||||
<kp.Manager object at 0x7f2ac075ca30>
|
||||
|
||||
>>> kp_logger.setLevel(logging.DEBUG)
|
||||
>>>
|
||||
>>> kp.Manager()
|
||||
DEBUG:kp:Kompute Manager creating instance
|
||||
DEBUG:kp:Kompute Manager Instance Created
|
||||
DEBUG:kp:Kompute Manager creating Device
|
||||
INFO:kp:Using physical device index {} found {}
|
||||
DEBUG:kp:Kompute Manager device created
|
||||
DEBUG:kp:Kompute Manager compute queue obtained
|
||||
DEBUG:kp:Kompute Manager Destructor started
|
||||
INFO:kp:Destroying device
|
||||
DEBUG:kp:Kompute Manager Destroyed Device
|
||||
DEBUG:kp:Kompute Manager Destroyed Instance
|
||||
<kp.Manager object at 0x7f2af6109e30>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue