From 911e7cfb0b2c4d2b0529cc4fb2cdb1ed2faac06a Mon Sep 17 00:00:00 2001 From: anonymous <anonymous> Date: Thu, 13 Jun 2019 10:35:54 +0200 Subject: [PATCH] add logging endpoints --- ckanext/odsh/controller.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ckanext/odsh/controller.py b/ckanext/odsh/controller.py index 20f9eed2..17df592b 100644 --- a/ckanext/odsh/controller.py +++ b/ckanext/odsh/controller.py @@ -145,6 +145,12 @@ class OdshApiController(ApiController): def action(self, logic_function, ver=None): if logic_function == 'resource_qv4yAI2rgotamXGk98gJ': return helpers.odsh_get_version_id() + if logic_function == 'log_qv4yAI2rgotamXGk98gJ': + if config.get('ckanext.odsh.enabletestendpoints', None) == 'True': + log.info('This is an info test log') + log.warning('This is an warning test log') + log.error('This is an error test log') + return 'ok' try: function = logic.get_action(logic_function) side_effect_free = getattr(function, 'side_effect_free', False) -- GitLab