Entries
Entries are the most basic unit for logging. They are simply a key-value pair.
All examples in the previous sections have logged entries.
For example, x
, y
, msg
and score
above are all entries.
Entry Contexts
Aside from logging contexts, we can also specify entry contexts.
Which will appear like so in the table:
These can also be nested:
Which will appear in the table like so:
Of course, this is not especially useful for the above example,
but if there are many nested function calls processing the data inside the subject
or grade
contexts,
then their use avoids the need to pass around the subject
or grade
contexts explicitly between all inner function calls,
when it’s known that they are constant for all inner computation and logging.
By default, unify.Entry("...")
also changes the behaviour of get_logs
, returning only the logs which include the entry.
This behaviour can be change by setting unify.Entry("...", mode="read")
which will only impact log getting,
and unify.Entry("...", mode="write")
which will only impact log setting.