v5.21.0 - Feedback wanted on convenient DBMS notifications #1064
robsdedude
announced in
Preview Features
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Convenient DBMS notifications
In version 5.21.0, we introduce a more convenient way of consuming server-side notifications (including warnings).
Logging
A new sub-logger
neo4j.notifications
is introduced.Every notification received will be logged through this logger.
The log-level is determined by the notification's severity.
If logging is not configured explicitly, warnings are logged to stderr.
This means that, by default, warnings like deprecations received from the DBMS will appear on stderr.
Warnings
A new driver-level configuration
warn_notification_severity
is introduced.It can be used to configure from which notification severity level upward the driver should emit a warning (i.e., call
warnings.warn
).By default (
None
), it will be set toOFF
(never emitting warnings on notifications), unless Python runs in development mode or the environment variablePYTHONNEO4JDEBUG
is set, in which case the driver will emit awarning on every notification.
Usage
This functionality if mainly meant for developing and debugging.
Therefore, no emphasis is put on efficiency.
However, it's impact is capt to a minimum when disabled.
It's assumed that in productions environments this feature is either disabled explicitly
or default behavior (see above) is used by not running Python in development mode.
Example
On an empty database, this leads to the following output:
Beta Was this translation helpful? Give feedback.
All reactions