Coverage for hexonet/apiconnector/logger.py: 89%
9 statements
« prev ^ index » next coverage.py v7.3.2, created at 2023-11-09 09:07 +0000
« prev ^ index » next coverage.py v7.3.2, created at 2023-11-09 09:07 +0000
1# -*- coding: utf-8 -*-
2"""
3 hexonet.apiconnector.logger
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 This module provides all necessary functionality for
6 debug outputs see the customlogger class on how to override this
7 :copyright: © 2018 by HEXONET GmbH.
8 :license: MIT, see LICENSE for more details.
9"""
11import sys
14class Logger(object):
15 """
16 The Logger class covers all you need to cover debug outputs of the API communication.
17 """
19 def log(self, post, r, error):
20 """
21 output/log given data
22 """
23 print(r.getCommandPlain())
24 print(post)
25 if error:
26 print("HTTP communication failed: %s" % (error), sys.stderr)
27 print(r.getPlain())