Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Cpython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sip
Cpython
Commits
a6c4ca9b
Unverified
Commit
a6c4ca9b
authored
Jul 15, 2022
by
Miss Islington (bot)
Committed by
GitHub
Jul 15, 2022
Browse files
Options
Downloads
Patches
Plain Diff
[3.11] [doc] Update cookbook example and add information about queue types. (GH-94854) (GH-94871)
(cherry picked from commit
dc541930
)
parent
3b6cb56d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Doc/howto/logging-cookbook.rst
+6
-1
6 additions, 1 deletion
Doc/howto/logging-cookbook.rst
Doc/library/logging.handlers.rst
+5
-0
5 additions, 0 deletions
Doc/library/logging.handlers.rst
with
11 additions
and
1 deletion
Doc/howto/logging-cookbook.rst
+
6
−
1
View file @
a6c4ca9b
...
...
@@ -219,7 +219,7 @@ messages should not. Here's how you can achieve this::
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m-%d %H:%M',
filename='/t
e
mp/myapp.log',
filename='/tmp/myapp.log',
filemode='w')
# define a Handler which writes INFO messages or higher to the sys.stderr
console = logging.StreamHandler()
...
...
@@ -270,6 +270,11 @@ are sent to both destinations.
This example uses console and file handlers, but you can use any number and
combination of handlers you choose.
Note that the above choice of log filename ``/tmp/myapp.log`` implies use of a
standard location for temporary files on POSIX systems. On Windows, you may need to
choose a different directory name for the log - just ensure that the directory exists
and that you have the permissions to create and update files in it.
Configuration server example
----------------------------
...
...
This diff is collapsed.
Click to expand it.
Doc/library/logging.handlers.rst
+
5
−
0
View file @
a6c4ca9b
...
...
@@ -1018,6 +1018,8 @@ possible, while any potentially slow operations (such as sending an email via
have the task tracking API, which means that you can use
:class:`~queue.SimpleQueue` instances for *queue*.
.. note:: If you are using :mod:`multiprocessing`, you should avoid using
:class:`~queue.SimpleQueue` and instead use :class:`multiprocessing.Queue`.
.. method:: emit(record)
...
...
@@ -1085,6 +1087,9 @@ possible, while any potentially slow operations (such as sending an email via
task tracking API (though it's used if available), which means that you can
use :class:`~queue.SimpleQueue` instances for *queue*.
.. note:: If you are using :mod:`multiprocessing`, you should avoid using
:class:`~queue.SimpleQueue` and instead use :class:`multiprocessing.Queue`.
If ``respect_handler_level`` is ``True``, a handler's level is respected
(compared with the level for the message) when deciding whether to pass
messages to that handler; otherwise, the behaviour is as in previous Python
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment