Skip to content

Commit 72c7497

Browse files
committed
Documentation updates; protobuf updates
1 parent 6addbc6 commit 72c7497

File tree

10 files changed

+256
-470
lines changed

10 files changed

+256
-470
lines changed

docs/introduction.txt

Lines changed: 44 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,50 @@ based on expression etc.
4646
Expressions used by these methods could be strings that contain Python expression referencing
4747
the collection item(s), or lambda functions.
4848

49-
Data conversion from/to string
50-
==============================
49+
Callback systems
50+
================
51+
52+
Module `~firebird.base.signal` provides two callback mechanisms: one based on signals and
53+
slots similar to Qt signal/slot, and second based on optional method delegation similar to
54+
events in Delphi.
55+
56+
In both cases, the callback callables could be functions, instance or class methods,
57+
partials and lambda functions. The `inspect` module is used to define the signature for
58+
callbacks, and to validate that only compatible callables are assigned.
59+
60+
Context-based logging
61+
=====================
62+
63+
Module `.logging` provides context-based logging system built on top of standard `logging`
64+
module. It also solves the common logging management problem when various modules use hard-coded
65+
separate loggers, and provides several types of message wrappers that allow lazy message
66+
interpolation using f-string, brace (`str.format`) or dollar (`string.Template`) formats.
67+
68+
The context-based logging:
69+
70+
1. Adds context information into `~logging.LogRecord`, that could be used in logging entry formats.
71+
2. Allows assignment of loggers to specific contexts.
72+
73+
Trace/audit for class instances
74+
===============================
75+
76+
Module `.trace` provides trace/audit logging for functions or object methods through
77+
context-based logging provided by `.logging` module.
78+
79+
The trace logging is performed by `.traced` decorator. You can use this decorator directly,
80+
or use `.TracedMixin` class to automatically decorate methods of class instances on creation.
81+
Each decorated callable could log messages before execution, after successful execution or
82+
on failed execution (when unhandled exception is raised by callable). The trace decorator
83+
can automatically add `agent` and `context` information, and include parameters passed to
84+
callable, execution time, return value, information about raised exception etc. to log messages.
85+
86+
The trace logging is managed by `.TraceManager`, that allows dynamic configuration of traced
87+
callables at runtime.
88+
89+
Trace supports configuration based on `~firebird.base.config`.
90+
91+
Symetric data conversion from/to string
92+
=======================================
5193

5294
While Python types typically support conversion to string via builtin `str()` function (and
5395
custom `__str__` methods), there is no symetric operation that converts string created by
@@ -91,42 +133,6 @@ Hook manager
91133
Module `.hooks` provides a general framework for callbacks and “hookable” events, that
92134
supports multiple usage strategies.
93135

94-
Context-based logging
95-
=====================
96-
97-
Module `.logging` provides context-based logging system built on top of standard `logging`
98-
module.
99-
100-
The context-based logging:
101-
102-
* Adds context information (defined as combination of topic, agent and context string values)
103-
into `~logging.LogRecord`, that could be used in logging message.
104-
* Adds support for f-string message format.
105-
* Allows assignment of loggers to specific contexts. The `.LoggingManager` class maintains
106-
a set of bindings between `Logger` objects and combination of `agent`, `context` and `topic`
107-
specifications. It’s possible to bind loggers to exact combination of values, or whole
108-
sets of values using `.ANY` sentinel. It means that is possible to assign specific Logger
109-
to log messages for particular agent in any context, or any agent operating in specific
110-
context etc.
111-
112-
Trace/audit for class instances
113-
===============================
114-
115-
Module `.trace` provides trace/audit logging for functions or object methods through
116-
context-based logging provided by `.logging` module.
117-
118-
The trace logging is performed by `.traced` decorator. You can use this decorator directly,
119-
or use `.TracedMixin` class to automatically decorate methods of class instances on creation.
120-
Each decorated callable could log messages before execution, after successful execution or
121-
on failed execution (when unhandled exception is raised by callable). The trace decorator
122-
can automatically add `agent` and `context` information, and include parameters passed to
123-
callable, execution time, return value, information about raised exception etc. to log messages.
124-
125-
The trace logging is managed by `.TraceManager`, that allows dynamic configuration of traced
126-
callables at runtime.
127-
128-
Trace supports configuration based on `~firebird.base.config`.
129-
130136
Registry for Google Protocol Buffer messages and enums
131137
======================================================
132138

@@ -135,13 +141,3 @@ The generated `*_pb2.py protobuf` files could be registered using `.register_dec
135141
`.load_registered` function. The registry could be then used to obtain information about
136142
protobuf messages or enum types, or to create message instances or enum values.
137143

138-
Callback systems
139-
================
140-
141-
Module `~firebird.base.signal` provides two callback mechanisms: one based on signals and
142-
slots similar to Qt signal/slot, and second based on optional method delegation similar to
143-
events in Delphi.
144-
145-
In both cases, the callback callables could be functions, instance or class methods,
146-
partials and lambda functions. The `inspect` module is used to define the signature for
147-
callbacks, and to validate that only compatible callables are assigned.

0 commit comments

Comments
 (0)