Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatools/logsink.py: 69%

62 statements  

« prev     ^ index     » next       coverage.py v7.6.4, created at 2024-10-31 17:39 +0000

1##################### generated by xml-casa (v2) from logsink.xml ################### 

2##################### ad6206dd3cfb9020972bfe0bbf653fca ############################## 

3from __future__ import absolute_import 

4from .__casac__.logsink import logsink as _logsink 

5 

6from .errors import create_error_string 

7from .typecheck import CasaValidator as _validator 

8_pc = _validator( ) 

9from .coercetype import coerce as _coerce 

10 

11 

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']) 

25 

26 def origin(self, fromwhere=''): 

27 """Sets the origin of messages to be displayed 

28 """ 

29 return self._swigobj.origin(fromwhere) 

30 

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) 

35 

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) 

43 

44 def filterMsg(self, msgList=[ ]): 

45 """Add messages to the filter out list 

46 """ 

47 return self._swigobj.filterMsg(msgList) 

48 

49 def clearFilterMsgList(self): 

50 """Clear list of messages to be filter out 

51 """ 

52 return self._swigobj.clearFilterMsgList() 

53 

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) 

58 

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) 

63 

64 def localId(self): 

65 """Returns the id for this class 

66 """ 

67 return self._swigobj.localId() 

68 

69 def version(self): 

70 """Returns the version of CASA as well as sending it to the log 

71 """ 

72 return self._swigobj.version() 

73 

74 def id(self): 

75 """Returns the ID of the LogSink in use 

76 """ 

77 return self._swigobj.id() 

78 

79 def setglobal(self, isglobal=True): 

80 """ 

81 """ 

82 return self._swigobj.setglobal(isglobal) 

83 

84 def setlogfile(self, filename='casapy.log'): 

85 """ 

86 """ 

87 return self._swigobj.setlogfile(filename) 

88 

89 def showconsole(self, onconsole=False): 

90 """ 

91 """ 

92 return self._swigobj.showconsole(onconsole) 

93 

94 def logfile(self): 

95 """Returns the full path of the log file 

96 """ 

97 return self._swigobj.logfile() 

98 

99 def ompNumThreadsTest(self): 

100 """ 

101 """ 

102 return self._swigobj.ompNumThreadsTest() 

103 

104 def ompGetNumThreads(self): 

105 """ 

106 """ 

107 return self._swigobj.ompGetNumThreads() 

108 

109 def ompSetNumThreads(self, numThreads=int(1)): 

110 """ 

111 """ 

112 return self._swigobj.ompSetNumThreads(numThreads) 

113 

114 def setMemoryTotal(self, memory=int(0)): 

115 """ 

116 """ 

117 return self._swigobj.setMemoryTotal(memory) 

118 

119 def setMemoryFraction(self, memfrac=int(0)): 

120 """ 

121 """ 

122 return self._swigobj.setMemoryFraction(memfrac) 

123 

124 def setNumCPUs(self, cores=int(0)): 

125 """ 

126 """ 

127 return self._swigobj.setNumCPUs(cores) 

128 

129 def getMemoryTotal(self, use_aipsrc=True): 

130 """ 

131 """ 

132 return self._swigobj.getMemoryTotal(use_aipsrc) 

133 

134 def getNumCPUs(self, use_aipsrc=True): 

135 """ 

136 """ 

137 return self._swigobj.getNumCPUs(use_aipsrc) 

138 

139 def getOrigin(self): 

140 """Gets the origin of messages to be displayed 

141 """ 

142 return self._swigobj.getOrigin() 

143