Package psychopy :: Module log
[frames] | no frames]

Module log

source code

Provides functions for logging error and other messages to one or more files and/or the console, using python's own logging module. Some warning messages and error messages are generated by PsychoPy itself. The user can generate more using the functions in this module.

There are various levels for logged messages; ranging from ERROR, through WARNING, to INFO and DEBUG. When setting the level for a particular log (file or console) the user can set the minimum level that is required for messages to enter the log. For example, setting a level of INFO will result in INFO, WARNING and ERROR messages to be recorded but not DEBUG nessages.

By default, PsychoPy will record messages of WARNING level and above to the console and INFO upwards to a psychopy.log in the current directory. The user can silence both by setting them to receive only CRITICAL messages, which (PsychoPy doesn't use) using the commands;

from psychopy import log
log.console.setLevel(log.CRITICAL)
Classes
  LogFile
Creates an object to help with logging events to a file
Functions
 
data(msg, *args, **kwargs)
log.data(message) Send the message to any receiver of logging info (e.g.
source code
Variables
  CRITICAL = 50
  ERROR = 40
  DATA = 35
  WARNING = 30
  INFO = 20
  DEBUG = 10
  console = logging.StreamHandler()
Function Details

data(msg, *args, **kwargs)

source code 
log.data(message) Send the message to any receiver of logging info (e.g. a LogFile) of level log.DATA or higher