OceanDirectPython 3.1.3
OceanDirect Python API
od_logger.py
Go to the documentation of this file.
1# -*- coding: utf-8 -*-
2"""
3Created on Tue Aug 14 15:30:43 2018
4
5@author: Ocean Insight Inc.
6"""
7
8import json
9
11 def __init__(self):
12 pass
13
14 def debug(self, message):
15 mtype = type(message)
16 if mtype is str:
17 print("DEBUG: %s" % message)
18 elif mtype is json:
19 print("DEBUG: %s" % json.dumps(message))
20 else:
21 str_msg = str(message)
22 print("DEBUG: %s" % json.dumps(str_msg))
23
24
25 def info(self, message):
26 mtype = type(message)
27 if mtype is str:
28 print("INFO: %s" % message)
29 elif mtype is json:
30 print("INFO: %s" % json.dumps(message))
31 else:
32 str_msg = str(message)
33 print("INFO: %s" % json.dumps(str_msg))
34
35
36 def warning(self, message):
37 mtype = type(message)
38 if mtype is str:
39 print("WARN: %s" % message)
40 elif mtype is json:
41 print("WARN: %s" % json.dumps(message))
42 else:
43 str_msg = str(message)
44 print("WARN: %s" % json.dumps(str_msg))
45
46
47 def error(self, message):
48 mtype = type(message)
49 if mtype is str:
50 print("ERROR: %s" % message)
51 elif mtype is json:
52 print("ERROR: %s" % json.dumps(message))
53 else:
54 str_msg = str(message)
55 print("ERROR: %s" % json.dumps(str_msg))
56