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

138 statements  

« prev     ^ index     » next       coverage.py v7.6.4, created at 2024-10-31 19:53 +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. 

6 

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 

40 

41try: 

42 _swig_property = property 

43except NameError: 

44 pass # Python < 2.2 doesn't have 'property'. 

45 

46try: 

47 import builtins as __builtin__ 

48except ImportError: 

49 import __builtin__ 

50 

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) 

68 

69 

70def _swig_setattr(self, class_type, name, value): 

71 return _swig_setattr_nondynamic(self, class_type, name, value, 0) 

72 

73 

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

81 

82 

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,) 

89 

90try: 

91 _object = object 

92 _newclass = 1 

93except __builtin__.Exception: 

94 class _object: 

95 pass 

96 _newclass = 0 

97 

98class logsink(_object): 

99 """Proxy of C++ casac::logsink class.""" 

100 

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 

106 

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 

114 

115 def origin(self, *args, **kwargs): 

116 """ 

117 origin(self, _fromwhere) -> bool 

118 

119 

120 

121 Summary: 

122 Set the origin of the message 

123 

124 Description: 

125 

126 Sets the origin of messages to be displayed 

127 

128 Input Parameters: 

129 fromwhere The origin of a log messages 

130 

131 -------------------------------------------------------------------------------- 

132 

133 """ 

134 return _logsink.logsink_origin(self, *args, **kwargs) 

135 

136 

137 def processorOrigin(self, *args, **kwargs): 

138 """ 

139 processorOrigin(self, _fromwhere) -> bool 

140 

141 

142 

143 Summary: 

144 Set the CASA processor origin 

145 

146 Description: 

147 

148 Sets the CASA processor origin which is shown at the end of each log origin 

149 

150 Input Parameters: 

151 fromwhere Input CASA processor origin name 

152 

153 -------------------------------------------------------------------------------- 

154 

155 """ 

156 return _logsink.logsink_processorOrigin(self, *args, **kwargs) 

157 

158 

159 def filter(self, *args, **kwargs): 

160 """ 

161 filter(self, _level) -> bool 

162 

163 

164 

165 Summary: 

166 Set the filter level 

167 

168 Description: 

169 

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. 

174 

175 Input Parameters: 

176 level Level of messages to display to the console/log file 

177 

178 -------------------------------------------------------------------------------- 

179 

180 """ 

181 return _logsink.logsink_filter(self, *args, **kwargs) 

182 

183 

184 def filterMsg(self, *args, **kwargs): 

185 """ 

186 filterMsg(self, _msgList) 

187 

188 

189 

190 Summary: 

191 Add messages to the filter out list 

192 

193 Description: 

194 

195 Add messages to the filter out list 

196 

197 Input Parameters: 

198 msgList Array of strings identifying messages to filter out 

199 

200 -------------------------------------------------------------------------------- 

201 

202 """ 

203 return _logsink.logsink_filterMsg(self, *args, **kwargs) 

204 

205 

206 def clearFilterMsgList(self): 

207 """ 

208 clearFilterMsgList(self) 

209 

210 

211 

212 Summary: 

213 Clear list of messages to be filter out 

214 

215 Description: 

216 

217 Clear list of messages to be filter out 

218 

219 -------------------------------------------------------------------------------- 

220 

221 """ 

222 return _logsink.logsink_clearFilterMsgList(self) 

223 

224 

225 def post(self, *args, **kwargs): 

226 """ 

227 post(self, _message, _priority, _origin) -> bool 

228 

229 

230 

231 Summary: 

232 Post a message 

233 

234 Description: 

235 

236 If the message passes the filter, write it (same as postLocally) 

237 

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 

242 

243 -------------------------------------------------------------------------------- 

244 

245 """ 

246 return _logsink.logsink_post(self, *args, **kwargs) 

247 

248 

249 def postLocally(self, *args, **kwargs): 

250 """ 

251 postLocally(self, _message, _priority, _origin) -> bool 

252 

253 

254 

255 Summary: 

256 Post locally 

257 

258 Description: 

259 

260 If the message passes the filter, write it 

261 

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 

266 

267 -------------------------------------------------------------------------------- 

268 

269 """ 

270 return _logsink.logsink_postLocally(self, *args, **kwargs) 

271 

272 

273 def localId(self): 

274 """ 

275 localId(self) -> string 

276 

277 

278 

279 Summary: 

280 Get local ID 

281 

282 Description: 

283 

284 Returns the id for this class 

285 

286 -------------------------------------------------------------------------------- 

287 

288 """ 

289 return _logsink.logsink_localId(self) 

290 

291 

292 def version(self): 

293 """ 

294 version(self) -> string 

295 

296 

297 

298 Summary: 

299 version of CASA 

300 

301 Description: 

302 

303 Returns the version of CASA as well as sending it to the log 

304 

305 Example: 

306 

307 casalog.version() 

308 

309 -------------------------------------------------------------------------------- 

310 

311 """ 

312 return _logsink.logsink_version(self) 

313 

314 

315 def id(self): 

316 """ 

317 id(self) -> string 

318 

319 

320 

321 Summary: 

322 Get ID 

323 

324 Description: 

325 

326 Returns the ID of the LogSink in use 

327 

328 -------------------------------------------------------------------------------- 

329 

330 """ 

331 return _logsink.logsink_id(self) 

332 

333 

334 def setglobal(self, *args, **kwargs): 

335 """ 

336 setglobal(self, _isglobal) -> bool 

337 

338 

339 

340 Summary: 

341 Set this logger to be the global logger 

342 

343 Input Parameters: 

344 isglobal Use as global logger 

345 

346 -------------------------------------------------------------------------------- 

347 

348 """ 

349 return _logsink.logsink_setglobal(self, *args, **kwargs) 

350 

351 

352 def setlogfile(self, *args, **kwargs): 

353 """ 

354 setlogfile(self, _filename) -> bool 

355 

356 

357 

358 Summary: 

359 Set the name of file for logger output 

360 

361 Input Parameters: 

362 filename filename for logger 

363 

364 -------------------------------------------------------------------------------- 

365 

366 """ 

367 return _logsink.logsink_setlogfile(self, *args, **kwargs) 

368 

369 

370 def showconsole(self, *args, **kwargs): 

371 """ 

372 showconsole(self, _onconsole) -> bool 

373 

374 

375 

376 Summary: 

377 Choose to send messages to the console/terminal 

378 

379 Input Parameters: 

380 onconsole All messages to the console as well as log file 

381 

382 -------------------------------------------------------------------------------- 

383 

384 """ 

385 return _logsink.logsink_showconsole(self, *args, **kwargs) 

386 

387 

388 def logfile(self): 

389 """ 

390 logfile(self) -> string 

391 

392 

393 

394 Summary: 

395 Returns the full path of the log file 

396 

397 Description: 

398 

399 Returns the full path of the log file 

400 

401 Example: 

402 

403 logfile = casalog.logfile() 

404 

405 -------------------------------------------------------------------------------- 

406 

407 """ 

408 return _logsink.logsink_logfile(self) 

409 

410 

411 def ompNumThreadsTest(self): 

412 """ 

413 ompNumThreadsTest(self) -> long 

414 

415 

416 

417 Summary: 

418 Determines the number of OpenMP threads in the current parallel region using an OpenMP reduction pragma 

419 

420 Example: 

421 

422 omp_num_thread = casalog.ompNumThreadsTest() 

423 

424 -------------------------------------------------------------------------------- 

425 

426 """ 

427 return _logsink.logsink_ompNumThreadsTest(self) 

428 

429 

430 def ompGetNumThreads(self): 

431 """ 

432 ompGetNumThreads(self) -> long 

433 

434 

435 

436 Summary: 

437 Returns the number of OpenMP threads in the current parallel region 

438 

439 Example: 

440 

441 omp_num_thread = casalog.ompNumThreadsTest() 

442 

443 -------------------------------------------------------------------------------- 

444 

445 """ 

446 return _logsink.logsink_ompGetNumThreads(self) 

447 

448 

449 def ompSetNumThreads(self, *args, **kwargs): 

450 """ 

451 ompSetNumThreads(self, _numThreads) -> bool 

452 

453 

454 

455 Summary: 

456 Specifies the number of OpenMP threads used by default in subsequent parallel regions 

457 

458 Input Parameters: 

459 numThreads  

460 

461 Example: 

462 

463 casalog.ompSetNumThreads(2) 

464 

465 -------------------------------------------------------------------------------- 

466 

467 """ 

468 return _logsink.logsink_ompSetNumThreads(self, *args, **kwargs) 

469 

470 

471 def setMemoryTotal(self, *args, **kwargs): 

472 """ 

473 setMemoryTotal(self, _memory) -> long 

474 

475 

476 

477 Summary: 

478 Sets the memory total value to be returned by HostInfo 

479 

480 Input Parameters: 

481 memory  

482 

483 Example: 

484 

485 casalog.setMemoryTotal(4*1024) 

486 

487 -------------------------------------------------------------------------------- 

488 

489 """ 

490 return _logsink.logsink_setMemoryTotal(self, *args, **kwargs) 

491 

492 

493 def setMemoryFraction(self, *args, **kwargs): 

494 """ 

495 setMemoryFraction(self, _memfrac) -> long 

496 

497 

498 

499 Summary: 

500 Sets the memory fraction value to be returned by HostInfo 

501 

502 Input Parameters: 

503 memfrac  

504 

505 Example: 

506 

507 casalog.setMemoryFraction(50) 

508 

509 -------------------------------------------------------------------------------- 

510 

511 """ 

512 return _logsink.logsink_setMemoryFraction(self, *args, **kwargs) 

513 

514 

515 def setNumCPUs(self, *args, **kwargs): 

516 """ 

517 setNumCPUs(self, _cores) -> long 

518 

519 

520 

521 Summary: 

522 Sets the number of CPUs to be returned by HostInfo 

523 

524 Input Parameters: 

525 cores  

526 

527 Example: 

528 

529 casalog.setNumCPUs(4) 

530 

531 -------------------------------------------------------------------------------- 

532 

533 """ 

534 return _logsink.logsink_setNumCPUs(self, *args, **kwargs) 

535 

536 

537 def getMemoryTotal(self, *args, **kwargs): 

538 """ 

539 getMemoryTotal(self, _use_aipsrc) -> long 

540 

541 

542 

543 Summary: 

544 Returns the memory total value from HostInfo 

545 

546 Input Parameters: 

547 use_aipsrc  

548 

549 Example: 

550 

551 casalog.getMemoryTotal(true) 

552 

553 -------------------------------------------------------------------------------- 

554 

555 """ 

556 return _logsink.logsink_getMemoryTotal(self, *args, **kwargs) 

557 

558 

559 def getNumCPUs(self, *args, **kwargs): 

560 """ 

561 getNumCPUs(self, _use_aipsrc) -> long 

562 

563 

564 

565 Summary: 

566 Returns the number of CPUs from HostInfo 

567 

568 Input Parameters: 

569 use_aipsrc  

570 

571 Example: 

572 

573 casalog.getNumCPUs(true) 

574 

575 -------------------------------------------------------------------------------- 

576 

577 """ 

578 return _logsink.logsink_getNumCPUs(self, *args, **kwargs) 

579 

580 

581 def getOrigin(self): 

582 """ 

583 getOrigin(self) -> string 

584 

585 

586 

587 Summary: 

588 Get the origin of the message 

589 

590 Description: 

591 

592 Gets the origin of messages to be displayed 

593 

594 -------------------------------------------------------------------------------- 

595 

596 """ 

597 return _logsink.logsink_getOrigin(self) 

598 

599 __swig_destroy__ = _logsink.delete_logsink 

600 __del__ = lambda self: None 

601logsink_swigregister = _logsink.logsink_swigregister 

602logsink_swigregister(logsink) 

603 

604# This file is compatible with both classic and new-style classes. 

605 

606