Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatools/logsink.py: 77%
62 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-01 07:19 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-01 07:19 +0000
1##################### generated by xml-casa (v2) from logsink.xml ###################
2##################### ad6206dd3cfb9020972bfe0bbf653fca ##############################
3from __future__ import absolute_import
4from .__casac__.logsink import logsink as _logsink
6from .errors import create_error_string
7from .typecheck import CasaValidator as _validator
8_pc = _validator( )
9from .coercetype import coerce as _coerce
12class logsink:
13 _info_group_ = """logsink"""
14 _info_desc_ = """tool for logsink"""
15 ### self, filename='casa.log'
16 def __init__(self, filename='casa.log', *args, **kwargs):
17 """
18 """
19 schema = {'filename': {'type': 'cStr', 'coerce': _coerce.to_str}}
20 doc = {'filename': filename}
21 assert _pc.validate(doc,schema), create_error_string(_pc.errors)
22 self._swigobj = kwargs.get('swig_object',None)
23 if self._swigobj is None:
24 self._swigobj = _logsink(_pc.document['filename'])
26 def origin(self, fromwhere=''):
27 """Sets the origin of messages to be displayed
28 """
29 return self._swigobj.origin(fromwhere)
31 def processorOrigin(self, fromwhere=''):
32 """Sets the CASA processor origin which is shown at the end of each log origin
33 """
34 return self._swigobj.processorOrigin(fromwhere)
36 def filter(self, level='DEBUG2'):
37 """Set the filter level of logging messages to be displayed.
38 This will determine what log messages go into the log file. The logger itself
39 can adjust what gets displayed so you could set INFO5 and then filter in the
40 logger everything above INFO1.
41 """
42 return self._swigobj.filter(level)
44 def filterMsg(self, msgList=[ ]):
45 """Add messages to the filter out list
46 """
47 return self._swigobj.filterMsg(msgList)
49 def clearFilterMsgList(self):
50 """Clear list of messages to be filter out
51 """
52 return self._swigobj.clearFilterMsgList()
54 def post(self, message, priority='INFO', origin=''):
55 """If the message passes the filter, write it (same as postLocally)
56 """
57 return self._swigobj.post(message, priority, origin)
59 def postLocally(self, message, priority='INFO', origin=''):
60 """If the message passes the filter, write it
61 """
62 return self._swigobj.postLocally(message, priority, origin)
64 def localId(self):
65 """Returns the id for this class
66 """
67 return self._swigobj.localId()
69 def version(self):
70 """Returns the version of CASA as well as sending it to the log
71 """
72 return self._swigobj.version()
74 def id(self):
75 """Returns the ID of the LogSink in use
76 """
77 return self._swigobj.id()
79 def setglobal(self, isglobal=True):
80 """
81 """
82 return self._swigobj.setglobal(isglobal)
84 def setlogfile(self, filename='casapy.log'):
85 """
86 """
87 return self._swigobj.setlogfile(filename)
89 def showconsole(self, onconsole=False):
90 """
91 """
92 return self._swigobj.showconsole(onconsole)
94 def logfile(self):
95 """Returns the full path of the log file
96 """
97 return self._swigobj.logfile()
99 def ompNumThreadsTest(self):
100 """
101 """
102 return self._swigobj.ompNumThreadsTest()
104 def ompGetNumThreads(self):
105 """
106 """
107 return self._swigobj.ompGetNumThreads()
109 def ompSetNumThreads(self, numThreads=int(1)):
110 """
111 """
112 return self._swigobj.ompSetNumThreads(numThreads)
114 def setMemoryTotal(self, memory=int(0)):
115 """
116 """
117 return self._swigobj.setMemoryTotal(memory)
119 def setMemoryFraction(self, memfrac=int(0)):
120 """
121 """
122 return self._swigobj.setMemoryFraction(memfrac)
124 def setNumCPUs(self, cores=int(0)):
125 """
126 """
127 return self._swigobj.setNumCPUs(cores)
129 def getMemoryTotal(self, use_aipsrc=True):
130 """
131 """
132 return self._swigobj.getMemoryTotal(use_aipsrc)
134 def getNumCPUs(self, use_aipsrc=True):
135 """
136 """
137 return self._swigobj.getNumCPUs(use_aipsrc)
139 def getOrigin(self):
140 """Gets the origin of messages to be displayed
141 """
142 return self._swigobj.getOrigin()