123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- .. This is a autogemerated documentation from python docstrings. It was generated using DStrings2Doc.
- .. module:: log
- .. _log:
- Module log
- ==========
- This is a custom logfile creation module
- .. py:class:: LogLevels:
- Used Log Levels Container
- .. py:class:: MeasurementLogger(object)
- Logfile creator class
- It will automatically get the info needed to create a logfile entry from registered functions.
- .. py:method:: __init__(self, filename=None, level=LogLevels.INFO, oneline=False)
- Initialise the logfile creator
- :param filename: (str) filename of the logfile THIS IS IGNORED AS OF NOW
- :param level: (int) valid log level (see LogLevels)
- :param oneline: (bool) whether to format the logfile entries in multilines or one line
- .. py:method:: __now(self)
- Get the current time in %Y-%m-%d %H:%M:%S format
- :return: the time
- .. py:method:: _logging_formatter(self, info)
- Formatter for the logfile entries
- Override this to implement custom formatters
- .. py:method:: _log(self, board_id, stuff)
- Write entries to logfile
- This will also make shure the directory the logfile is located is available and if not creates it
- :param stuff: (str) the entrie to write
- .. py:method:: register_parameter(self, logstring, func, args)
- This function is used to register parameters for the logfile entries
- :param logstring: (str) the string to describe the value in the logfile
- :param func: (callable) the function used to get the value
- :param args: arguments to pass to func upon gathering of information
- .. py:method:: reset_parameters(self)
- Resets all parameters (unregisteres all parameters)
- .. py:method:: register_dumper(self, func)
- Register a dumper that is used to dump a log of data into the logfile
- :param func: (callable) Function that is used as dumper
- .. py:method:: dump(self, board_id)
- Perform a dump (see register_dumper)
- .. py:method:: do_log(self, c=None, additional=None, board_id=None, level=LogLevels.INFO)
- Perform a log. This creates a log entry in the logfile
- :param c: (str) if this is not None this is the only text written to the logfile (in addition to the current time)
- :param additional: (str) This text is written below the current time to customize log entries
- :param board_id: the id of the board to log for, if this is not given, all boards are logged
- .. py:method:: log(c=None, additional=None, dump=False, board_id=None, level=LogLevels.INFO)
- Execute logging if logger was registered
- :param (str) c: if this is given c is the only entry that is created (additional is ignored)
- :param (str) additional: the additional text that is written below the current time
- :param (bool) dump: if this is true, a dump of every log value is performed
- :param board_id: the board id to log for, if this is not given, all boards are logged
- .. py:class:: ConfigureLog(QtGui.QDialog)
- Class that is basically a QDialog to configure the logger
- .. py:method:: __init__(self, parent=None):
- .. py:method:: initial_ticks(self)
- Set the initial ticks.
- .. py:method:: all_changed(self)
- This is called when the "all" checkbox is checked. It de/activates the other checkboxes
- .. py:method:: do(self)
- Change the logger instance to the activated log entries
|