Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatools/__casac__/logsink.py: 58%
138 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# This file was automatically generated by SWIG (http://www.swig.org).
2# Version 3.0.12
3#
4# Do not make changes to this file unless you know what you are doing--modify
5# the SWIG interface file instead.
7from sys import version_info as _swig_python_version_info
8if _swig_python_version_info >= (2, 7, 0):
9 def swig_import_helper():
10 import importlib
11 pkg = __name__.rpartition('.')[0]
12 mname = '.'.join((pkg, '_logsink')).lstrip('.')
13 try:
14 return importlib.import_module(mname)
15 except ImportError:
16 return importlib.import_module('_logsink')
17 _logsink = swig_import_helper()
18 del swig_import_helper
19elif _swig_python_version_info >= (2, 6, 0):
20 def swig_import_helper():
21 from os.path import dirname
22 import imp
23 fp = None
24 try:
25 fp, pathname, description = imp.find_module('_logsink', [dirname(__file__)])
26 except ImportError:
27 import _logsink
28 return _logsink
29 try:
30 _mod = imp.load_module('_logsink', fp, pathname, description)
31 finally:
32 if fp is not None:
33 fp.close()
34 return _mod
35 _logsink = swig_import_helper()
36 del swig_import_helper
37else:
38 import _logsink
39del _swig_python_version_info
41try:
42 _swig_property = property
43except NameError:
44 pass # Python < 2.2 doesn't have 'property'.
46try:
47 import builtins as __builtin__
48except ImportError:
49 import __builtin__
51def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
52 if (name == "thisown"):
53 return self.this.own(value)
54 if (name == "this"):
55 if type(value).__name__ == 'SwigPyObject':
56 self.__dict__[name] = value
57 return
58 method = class_type.__swig_setmethods__.get(name, None)
59 if method:
60 return method(self, value)
61 if (not static):
62 if _newclass:
63 object.__setattr__(self, name, value)
64 else:
65 self.__dict__[name] = value
66 else:
67 raise AttributeError("You cannot add attributes to %s" % self)
70def _swig_setattr(self, class_type, name, value):
71 return _swig_setattr_nondynamic(self, class_type, name, value, 0)
74def _swig_getattr(self, class_type, name):
75 if (name == "thisown"):
76 return self.this.own()
77 method = class_type.__swig_getmethods__.get(name, None)
78 if method:
79 return method(self)
80 raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
83def _swig_repr(self):
84 try:
85 strthis = "proxy of " + self.this.__repr__()
86 except __builtin__.Exception:
87 strthis = ""
88 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
90try:
91 _object = object
92 _newclass = 1
93except __builtin__.Exception:
94 class _object:
95 pass
96 _newclass = 0
98class logsink(_object):
99 """Proxy of C++ casac::logsink class."""
101 __swig_setmethods__ = {}
102 __setattr__ = lambda self, name, value: _swig_setattr(self, logsink, name, value)
103 __swig_getmethods__ = {}
104 __getattr__ = lambda self, name: _swig_getattr(self, logsink, name)
105 __repr__ = _swig_repr
107 def __init__(self, *args, **kwargs):
108 """__init__(self, _filename) -> logsink"""
109 this = _logsink.new_logsink(*args, **kwargs)
110 try:
111 self.this.append(this)
112 except __builtin__.Exception:
113 self.this = this
115 def origin(self, *args, **kwargs):
116 """
117 origin(self, _fromwhere) -> bool
121 Summary:
122 Set the origin of the message
124 Description:
126 Sets the origin of messages to be displayed
128 Input Parameters:
129 fromwhere The origin of a log messages
131 --------------------------------------------------------------------------------
133 """
134 return _logsink.logsink_origin(self, *args, **kwargs)
137 def processorOrigin(self, *args, **kwargs):
138 """
139 processorOrigin(self, _fromwhere) -> bool
143 Summary:
144 Set the CASA processor origin
146 Description:
148 Sets the CASA processor origin which is shown at the end of each log origin
150 Input Parameters:
151 fromwhere Input CASA processor origin name
153 --------------------------------------------------------------------------------
155 """
156 return _logsink.logsink_processorOrigin(self, *args, **kwargs)
159 def filter(self, *args, **kwargs):
160 """
161 filter(self, _level) -> bool
165 Summary:
166 Set the filter level
168 Description:
170 Set the filter level of logging messages to be displayed.
171 This will determine what log messages go into the log file. The logger itself
172 can adjust what gets displayed so you could set INFO5 and then filter in the
173 logger everything above INFO1.
175 Input Parameters:
176 level Level of messages to display to the console/log file
178 --------------------------------------------------------------------------------
180 """
181 return _logsink.logsink_filter(self, *args, **kwargs)
184 def filterMsg(self, *args, **kwargs):
185 """
186 filterMsg(self, _msgList)
190 Summary:
191 Add messages to the filter out list
193 Description:
195 Add messages to the filter out list
197 Input Parameters:
198 msgList Array of strings identifying messages to filter out
200 --------------------------------------------------------------------------------
202 """
203 return _logsink.logsink_filterMsg(self, *args, **kwargs)
206 def clearFilterMsgList(self):
207 """
208 clearFilterMsgList(self)
212 Summary:
213 Clear list of messages to be filter out
215 Description:
217 Clear list of messages to be filter out
219 --------------------------------------------------------------------------------
221 """
222 return _logsink.logsink_clearFilterMsgList(self)
225 def post(self, *args, **kwargs):
226 """
227 post(self, _message, _priority, _origin) -> bool
231 Summary:
232 Post a message
234 Description:
236 If the message passes the filter, write it (same as postLocally)
238 Input Parameters:
239 message Message to be posted
240 priority Priority of message to be posted
241 origin Origin of message to be posted
243 --------------------------------------------------------------------------------
245 """
246 return _logsink.logsink_post(self, *args, **kwargs)
249 def postLocally(self, *args, **kwargs):
250 """
251 postLocally(self, _message, _priority, _origin) -> bool
255 Summary:
256 Post locally
258 Description:
260 If the message passes the filter, write it
262 Input Parameters:
263 message Message to be posted
264 priority Priority of message to be posted
265 origin Origin of message to be posted
267 --------------------------------------------------------------------------------
269 """
270 return _logsink.logsink_postLocally(self, *args, **kwargs)
273 def localId(self):
274 """
275 localId(self) -> string
279 Summary:
280 Get local ID
282 Description:
284 Returns the id for this class
286 --------------------------------------------------------------------------------
288 """
289 return _logsink.logsink_localId(self)
292 def version(self):
293 """
294 version(self) -> string
298 Summary:
299 version of CASA
301 Description:
303 Returns the version of CASA as well as sending it to the log
305 Example:
307 casalog.version()
309 --------------------------------------------------------------------------------
311 """
312 return _logsink.logsink_version(self)
315 def id(self):
316 """
317 id(self) -> string
321 Summary:
322 Get ID
324 Description:
326 Returns the ID of the LogSink in use
328 --------------------------------------------------------------------------------
330 """
331 return _logsink.logsink_id(self)
334 def setglobal(self, *args, **kwargs):
335 """
336 setglobal(self, _isglobal) -> bool
340 Summary:
341 Set this logger to be the global logger
343 Input Parameters:
344 isglobal Use as global logger
346 --------------------------------------------------------------------------------
348 """
349 return _logsink.logsink_setglobal(self, *args, **kwargs)
352 def setlogfile(self, *args, **kwargs):
353 """
354 setlogfile(self, _filename) -> bool
358 Summary:
359 Set the name of file for logger output
361 Input Parameters:
362 filename filename for logger
364 --------------------------------------------------------------------------------
366 """
367 return _logsink.logsink_setlogfile(self, *args, **kwargs)
370 def showconsole(self, *args, **kwargs):
371 """
372 showconsole(self, _onconsole) -> bool
376 Summary:
377 Choose to send messages to the console/terminal
379 Input Parameters:
380 onconsole All messages to the console as well as log file
382 --------------------------------------------------------------------------------
384 """
385 return _logsink.logsink_showconsole(self, *args, **kwargs)
388 def logfile(self):
389 """
390 logfile(self) -> string
394 Summary:
395 Returns the full path of the log file
397 Description:
399 Returns the full path of the log file
401 Example:
403 logfile = casalog.logfile()
405 --------------------------------------------------------------------------------
407 """
408 return _logsink.logsink_logfile(self)
411 def ompNumThreadsTest(self):
412 """
413 ompNumThreadsTest(self) -> long
417 Summary:
418 Determines the number of OpenMP threads in the current parallel region using an OpenMP reduction pragma
420 Example:
422 omp_num_thread = casalog.ompNumThreadsTest()
424 --------------------------------------------------------------------------------
426 """
427 return _logsink.logsink_ompNumThreadsTest(self)
430 def ompGetNumThreads(self):
431 """
432 ompGetNumThreads(self) -> long
436 Summary:
437 Returns the number of OpenMP threads in the current parallel region
439 Example:
441 omp_num_thread = casalog.ompNumThreadsTest()
443 --------------------------------------------------------------------------------
445 """
446 return _logsink.logsink_ompGetNumThreads(self)
449 def ompSetNumThreads(self, *args, **kwargs):
450 """
451 ompSetNumThreads(self, _numThreads) -> bool
455 Summary:
456 Specifies the number of OpenMP threads used by default in subsequent parallel regions
458 Input Parameters:
459 numThreads
461 Example:
463 casalog.ompSetNumThreads(2)
465 --------------------------------------------------------------------------------
467 """
468 return _logsink.logsink_ompSetNumThreads(self, *args, **kwargs)
471 def setMemoryTotal(self, *args, **kwargs):
472 """
473 setMemoryTotal(self, _memory) -> long
477 Summary:
478 Sets the memory total value to be returned by HostInfo
480 Input Parameters:
481 memory
483 Example:
485 casalog.setMemoryTotal(4*1024)
487 --------------------------------------------------------------------------------
489 """
490 return _logsink.logsink_setMemoryTotal(self, *args, **kwargs)
493 def setMemoryFraction(self, *args, **kwargs):
494 """
495 setMemoryFraction(self, _memfrac) -> long
499 Summary:
500 Sets the memory fraction value to be returned by HostInfo
502 Input Parameters:
503 memfrac
505 Example:
507 casalog.setMemoryFraction(50)
509 --------------------------------------------------------------------------------
511 """
512 return _logsink.logsink_setMemoryFraction(self, *args, **kwargs)
515 def setNumCPUs(self, *args, **kwargs):
516 """
517 setNumCPUs(self, _cores) -> long
521 Summary:
522 Sets the number of CPUs to be returned by HostInfo
524 Input Parameters:
525 cores
527 Example:
529 casalog.setNumCPUs(4)
531 --------------------------------------------------------------------------------
533 """
534 return _logsink.logsink_setNumCPUs(self, *args, **kwargs)
537 def getMemoryTotal(self, *args, **kwargs):
538 """
539 getMemoryTotal(self, _use_aipsrc) -> long
543 Summary:
544 Returns the memory total value from HostInfo
546 Input Parameters:
547 use_aipsrc
549 Example:
551 casalog.getMemoryTotal(true)
553 --------------------------------------------------------------------------------
555 """
556 return _logsink.logsink_getMemoryTotal(self, *args, **kwargs)
559 def getNumCPUs(self, *args, **kwargs):
560 """
561 getNumCPUs(self, _use_aipsrc) -> long
565 Summary:
566 Returns the number of CPUs from HostInfo
568 Input Parameters:
569 use_aipsrc
571 Example:
573 casalog.getNumCPUs(true)
575 --------------------------------------------------------------------------------
577 """
578 return _logsink.logsink_getNumCPUs(self, *args, **kwargs)
581 def getOrigin(self):
582 """
583 getOrigin(self) -> string
587 Summary:
588 Get the origin of the message
590 Description:
592 Gets the origin of messages to be displayed
594 --------------------------------------------------------------------------------
596 """
597 return _logsink.logsink_getOrigin(self)
599 __swig_destroy__ = _logsink.delete_logsink
600 __del__ = lambda self: None
601logsink_swigregister = _logsink.logsink_swigregister
602logsink_swigregister(logsink)
604# This file is compatible with both classic and new-style classes.