OceanDirectPython
3.1.3
OceanDirect Python API
Main Page
Related Pages
Packages
Classes
Files
File List
os-support
windows
VisualStudio2017
PythonOceanDirect
Python
oceandirect
od_logger.py
Go to the documentation of this file.
1
# -*- coding: utf-8 -*-
2
"""
3
Created on Tue Aug 14 15:30:43 2018
4
5
@author: Ocean Insight Inc.
6
"""
7
8
import
json
9
10
class
od_logger
:
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
Python.oceandirect.od_logger.od_logger
Definition
od_logger.py:10
Python.oceandirect.od_logger.od_logger.info
info(self, message)
Definition
od_logger.py:25
Python.oceandirect.od_logger.od_logger.error
error(self, message)
Definition
od_logger.py:47
Python.oceandirect.od_logger.od_logger.debug
debug(self, message)
Definition
od_logger.py:14
Python.oceandirect.od_logger.od_logger.__init__
__init__(self)
Definition
od_logger.py:11
Python.oceandirect.od_logger.od_logger.warning
warning(self, message)
Definition
od_logger.py:36
Generated by
1.12.0