Skip to content

Commit

Permalink
Merge branch 'master' into issue_401
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Feb 5, 2019
2 parents 9024faf + 26f9ad5 commit 53cef22
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 68 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Expand Up @@ -41,6 +41,9 @@ Other changes
- Document filesystem caching for Chameleon page templates
(`#291 <https://github.com/zopefoundation/Zope/issues/291>`_)

- Remove obsolete environment variable "Z_DEBUG_MODE"
(`#445 <https://github.com/zopefoundation/Zope/issues/445>`_)

Breaking changes
++++++++++++++++

Expand Down
38 changes: 18 additions & 20 deletions docs/zdgbook/ObjectPublishing.rst
Expand Up @@ -2,17 +2,29 @@
Object Publishing
#################

.. include:: includes/zope2_notice.rst
.. attention::

This document is currently being reviewed and edited for the
upcoming release of Zope 4.

.. note::

Previously, this document contained information about access by
FTP and WebDAV. As those functionalities were provided by the now
removed ZServer, the related information also has been removed.

Please directly refer to the ZServer package for further
information.


Introduction
============

Zope puts your objects on the web. This is called *object
publishing*. One of Zope's unique characteristics is the way it
Zope puts your objects on the web. This is called **object
publishing**. One of Zope's unique characteristics is the way it
allows you to walk up to your objects and call methods on them with
simple URLs. In addition to HTTP, Zope makes your objects available
to other network protocols including FTP, WebDAV and XML-RPC.

via XML-RPC.

In this chapter you'll find out exactly how Zope publishes objects.
You'll learn all you need to know in order to design your objects for
Expand Down Expand Up @@ -574,22 +586,11 @@ Environment Variables
You can control some facets of the publisher's operation by setting
environment variables.

- 'Z_DEBUG_MODE' -- Sets debug mode. In debug mode tracebacks are not
hidden in error pages. Also debug mode causes 'DTMLFile' objects,
External Methods and help topics to reload their contents from disk
when changed. You can also set debug mode with the '-D' switch when
starting Zope.

- 'Z_REALM' -- Sets the basic authorization realm. This controls the
realm name as it appears in the web browser's username and password
dialog. You can also set the realm with the '__bobo_realm__' module
variable, as mentioned previously.

- 'PROFILE_PUBLISHER' -- Turns on profiling and sets the name of the
profile file. See the Python documentation for more information
about the Python profiler.


Many more options can be set using switches on the startup script.
See the *Zope Administrator's Guide* for more information.

Expand Down Expand Up @@ -971,10 +972,7 @@ There are two exceptions to the above rule:
returned.

When a body is returned, traceback information will be included in a
comment in the output. As mentioned earlier, the environment variable
'Z_DEBUG_MODE' can be used to control how tracebacks are included. If
this variable is set then tracebacks are included in 'PRE' tags,
rather than in comments. This is very handy during debugging.
comment in the output.

Exceptions and Transactions
---------------------------
Expand Down
39 changes: 1 addition & 38 deletions docs/zdgbook/TestingAndDebugging.rst
Expand Up @@ -20,40 +20,6 @@ Zope provides debugging information through a number of sources. It
also allows you a couple avenues for getting information about Zope
as it runs.

The Control Panel
-----------------

The control panel provides a number of views that can help you debug
Zope, especially in the area of performance. The *Debugging
Information* link on the control panel provides two views, *Debugging
Info* and *Profiling*.

Debugging info provides information on the number of object
references and the status of open requests. The object references
list displays the name of the object and the number of references to
that object in Zope. Understanding how reference counts help
debugging is a lengthy subject, but in general you can spot memory
leaks in your application if the number of references to certain
objects increases without bound. The busier your site is, or the
more content it holds, the more reference counts you will tend to
have.

Profiling uses the standard Python profiler. This is turned on by
setting the 'PROFILE_PUBLISHER' environment variable before executing
Zope.

When the profiler is running, the performance of your Zope system
will suffer a lot. Profiling should only be used for short periods
of time, or on a separate ZEO client so that your normal users to not
experience this significant penalty.

Profiling provides you with information about which methods in your
Zope system are taking the most time to execute. It builds a
*profile*, which lists the busiest methods on your system, sorted by
increasing resource usage. For details on the meaning of the
profiler's output, read the `standard Python documentation
<http://www.python.org/doc/current/lib/profile.html>`_

Product Refresh Settings
------------------------

Expand All @@ -77,7 +43,7 @@ idea to only turn it on for a few products at a time.
Debug Mode
----------

Setting the 'Z_DEBUG_MODE=1' environment puts Zope into debug mode.
Normally, debug mode is set using the '-D' switch when starting Zope.
This mode reduces the performance of Zope a little bit. Debug model
has a number of wide ranging effects:

Expand All @@ -91,9 +57,6 @@ has a number of wide ranging effects:
will remain attached to the terminal that started it and the main
logging information will be redirected to that terminal.

Normally, debug mode is set using the '-D' switch when starting Zope,
though you can set the environment variable directly if you wish.

By using debug mode and product refresh together you will have little
reason to restart Zope while developing.

Expand Down
9 changes: 4 additions & 5 deletions docs/zope2book/MaintainingZope.rst
Expand Up @@ -35,14 +35,13 @@ Debug Mode and Automatic Startup
If you are planning to run Zope on a Unix production system you should also
disable *debug mode*. This means removing the `-D` option in startup scripts
(e.g. the `start` script created by Zope at installation time which calls z2.py
with the `-D` switch) and if you've manually set it, unsetting the
`Z_DEBUG_MODE` environment variable. In debug mode, Zope does not detach itself
with the `-D` switch). In debug mode, Zope does not detach itself
from the terminal, which could cause startup scripts to malfunction.

On Windows, running Zope as a service disables debug mode by default. You still
can run Zope in debug mode by setting the `Z_DEBUG_MODE` environment variable
or running Zope manually from a startup script with the `-D` option. Again,
this is not recommended for production systems, since debug mode causes
can run Zope in debug mode by running Zope manually from a startup script with
the `-D` option.
Again, this is not recommended for production systems, since debug mode causes
performance loss.

Automatic Startup for Custom-Built Zopes
Expand Down
5 changes: 0 additions & 5 deletions src/Zope2/Startup/handlers.py
Expand Up @@ -46,11 +46,6 @@ def _setenv(name, value):
os.environ[name] = repr(value)


def debug_mode(value):
value and _setenv('Z_DEBUG_MODE', '1')
return value


def locale(value):
import locale
locale.setlocale(locale.LC_ALL, value)
Expand Down

0 comments on commit 53cef22

Please sign in to comment.