logsink
- class logsink[source]
tool for logsink
Methods Summary
Clear list of messages to be filter out
Set the filter level of logging messages to be displayed.
Add messages to the filter out list
Returns the memory total value from HostInfo
Returns the number of CPUs from HostInfo
Gets the origin of messages to be displayed
Returns the ID of the LogSink in use
Returns the id for this class
Returns the full path of the log file
Construct a logsink tool
Returns the number of OpenMP threads in the current parallel region
Determines the number of OpenMP threads in the current parallel region using an OpenMP reduction pragma
Specifies the number of OpenMP threads used by default in subsequent parallel regions
Sets the origin of messages to be displayed
If the message passes the filter, write it (same as postLocally)
If the message passes the filter, write it
Sets the CASA processor origin which is shown at the end of each log origin
Sets the memory fraction value to be returned by HostInfo
Sets the memory total value to be returned by HostInfo
Sets the number of CPUs to be returned by HostInfo
Set this logger to be the global logger
Set the name of file for logger output
Choose to send messages to the console/terminal
Returns the version of CASA as well as sending it to the log
- filter(level='ERROR')[source]
Set the filter level of logging messages to be displayed. This will determine what log messages go into the log file. The logger itself can adjust what gets displayed so you could set INFO5 and then filter in the logger everything above INFO1.
Parameters
level (string='ERROR')
- Level of messages to display to the console/log file
Returns
bool
- filterMsg(msgList='')[source]
Add messages to the filter out list
Parameters
msgList (stringVec='')
- Array of strings identifying messages to filter out
Returns
void
- getMemoryTotal(use_aipsrc=True)[source]
Returns the memory total value from HostInfo
Parameters
use_aipsrc (bool=True)
Returns
int
Examples
casalog.getMemoryTotal(True)
- getNumCPUs(use_aipsrc=True)[source]
Returns the number of CPUs from HostInfo
Parameters
use_aipsrc (bool=True)
Returns
int
Examples
casalog.getNumCPUs(True)
- logsink(filename='casa.log')[source]
Construct a logsink tool
Parameters
filename (string='casa.log')
- logfile name
- ompNumThreadsTest()[source]
Determines the number of OpenMP threads in the current parallel region using an OpenMP reduction pragma
- ompSetNumThreads(numThreads=1)[source]
Specifies the number of OpenMP threads used by default in subsequent parallel regions
Parameters
numThreads (int=1)
Returns
bool
Examples
casalog.ompSetNumThreads(2)
- origin(fromwhere='')[source]
Sets the origin of messages to be displayed
Parameters
fromwhere (string='')
- The origin of a log messages
Returns
bool
- post(message='', priority='INFO', origin='')[source]
If the message passes the filter, write it (same as postLocally)
Parameters
message (string='')
- Message to be postedpriority (string='INFO')
- Priority of message to be postedorigin (string='')
- Origin of message to be posted
Returns
bool
- postLocally(message='', priority='INFO', origin='')[source]
If the message passes the filter, write it
Parameters
message (string='')
- Message to be postedpriority (string='INFO')
- Priority of message to be postedorigin (string='')
- Origin of message to be posted
Returns
bool
- processorOrigin(fromwhere='')[source]
Sets the CASA processor origin which is shown at the end of each log origin
Parameters
fromwhere (string='')
- Input CASA processor origin name
Returns
bool
- setMemoryFraction(memfrac=0)[source]
Sets the memory fraction value to be returned by HostInfo
Parameters
memfrac (int=0)
Returns
int
Examples
casalog.setMemoryFraction(50)
- setMemoryTotal(memory=0)[source]
Sets the memory total value to be returned by HostInfo
Parameters
memory (int=0)
Returns
int
Examples
casalog.setMemoryTotal(4*1024)
- setNumCPUs(cores=0)[source]
Sets the number of CPUs to be returned by HostInfo
Parameters
cores (int=0)
Returns
int
Examples
casalog.setNumCPUs(4)
- setglobal(isglobal=True)[source]
Set this logger to be the global logger
Parameters
isglobal (bool=True)
- Use as global logger
Returns
bool
- setlogfile(filename='casapy.log')[source]
Set the name of file for logger output
Parameters
filename (string='casapy.log')
- filename for logger
Returns
bool