From: Ricardo Dias Date: Thu, 17 Oct 2019 09:15:33 +0000 (+0100) Subject: mgr/dashboard: hacking.rst: update backend logging instructions X-Git-Tag: v15.1.0~694^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c6147744d932c2592f81a82bc79182df00730a86;p=ceph.git mgr/dashboard: hacking.rst: update backend logging instructions Signed-off-by: Ricardo Dias --- diff --git a/src/pybind/mgr/dashboard/HACKING.rst b/src/pybind/mgr/dashboard/HACKING.rst index 25b50e2b4cd0..b273f0daee3f 100644 --- a/src/pybind/mgr/dashboard/HACKING.rst +++ b/src/pybind/mgr/dashboard/HACKING.rst @@ -1175,16 +1175,18 @@ How to access the manager module instance from a controller? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We provide the manager module instance as a global variable that can be -imported in any module. We also provide a logger instance in the same way. +imported in any module. Example: .. code-block:: python + import logging import cherrypy - from .. import logger, mgr + from .. import mgr from ..tools import ApiController, RESTController + logger = logging.getLogger(__name__) @ApiController('servers') class Servers(RESTController): @@ -2024,7 +2026,7 @@ facilitates the basic tasks (Options, Commands, and common Mixins). The previous plugin could be rewritten like this: .. code-block:: python - + from . import PLUGIN_MANAGER as PM from . import interfaces as I from .plugin import SimplePlugin as SP