launch.logging package

Submodules

Module contents

Module for the launch specific logging.

launch.logging.get_logger(name=None) Logger[source]

Get named logger, configured to output to screen and launch main log file.

launch.logging.get_output_loggers(process_name, output_config)[source]

Get the stdout and stderr output loggers for the given process name.

The output_config may be a dictionary with one or more of the optional keys ‘stdout’, ‘stderr’, or ‘both’ (stdout and stderr combined) which represent the various process output sources, and values for those keys to assign one or more logging destinations to the source. The logging destination values may be:

  • ‘screen’: log it to the screen,

  • ‘log’: log it to launch log file, or

  • ‘own_log’: log it to a separate log file.

When logging the stdout and stderr separately, the log file names follow the <process_name>-<source>.log pattern where <source> is either ‘stdout’ or ‘stderr’ When the ‘both’ logging destination is used the log file name follows the <process_name>.log pattern.

The “launch log file” is a log file which is create for each run of the launch.LaunchService, and at least captures the log output from launch itself, but may also include output from subprocess’s if configured so.

Alternatively, the output_config parameter may be a string which represents one of a couple available aliases for common logging configurations. The available aliases are:

  • ‘screen’: stdout and stderr are logged to the screen,

  • ‘log’: stdout and stderr are logged to launch log file and stderr to

    the screen,

  • ‘both’: both stdout and stderr are logged to the screen and to launch

    main log file,

  • ‘own_log’ for stdout, stderr and their combination to be logged to

    their own log files, and

  • ‘full’ to have stdout and stderr sent to the screen, to the main launch

    log file, and their own separate and combined log files.

Parameters:
  • process_name – the process-like action whose outputs want to be logged.

  • output_config – configuration for the output loggers, see above for details.

Returns:

a tuple with the stdout and stderr output loggers.

launch.logging.reset()[source]

Reset logging.