easybuild.tools.build_log module

EasyBuild logger and log utilities, including our own EasybuildError class.

author:Stijn De Weirdt (Ghent University)
author:Dries Verdegem (Ghent University)
author:Kenneth Hoste (Ghent University)
author:Pieter De Baets (Ghent University)
author:Jens Timmerman (Ghent University)
exception easybuild.tools.build_log.EasyBuildError(msg, *args)

Bases: easybuild.base.exceptions.LoggedException

EasyBuildError is thrown when EasyBuild runs into something horribly wrong.

LOC_INFO_TOP_PKG_NAMES = ['easybuild', 'vsc']
class easybuild.tools.build_log.EasyBuildLog(name, level=0)

Bases: easybuild.base.fancylogger.FancyLogger

The EasyBuild logger, with its own error and exception functions.


alias of EasyBuildError


Return string with caller info.

deprecated(msg, ver, max_ver=None, more_info=None, silent=False, *args, **kwargs)

Print deprecation warning or raise an exception, depending on specified version(s)


msg: deprecation message

  • ver – if max_ver is None: threshold for EasyBuild version to determine warning vs exception else: version to check against max_ver to determine warning vs exception
  • max_ver – version threshold for warning vs exception (compared to ‘ver’)
  • more_info – additional message with instructions where to get more information
  • silent – stay silent (don’t print deprecation warnings, only log them)
devel(msg, *args, **kwargs)

Print development log message

error(msg, *args, **kwargs)

Print error message and raise an EasyBuildError.

exception(msg, *args)

Print exception message and raise EasyBuildError.

experimental(msg, *args, **kwargs)

Handle experimental functionality if EXPERIMENTAL is True, otherwise log error

nosupport(msg, ver)

Raise error message for no longer supported behaviour, and raise an EasyBuildError.

easybuild.tools.build_log.dry_run_msg(msg, *args, **kwargs)

Print dry run message.

easybuild.tools.build_log.dry_run_set_dirs(prefix, builddir, software_installdir, module_installdir)

Initialize for printing dry run messages.

Define DRY_RUN_*DIR constants, so they can be used in dry_run_msg to replace fake build/install dirs.

  • prefix – prefix of fake build/install dirs, that can be stripped off when printing
  • builddir – fake build dir
  • software_installdir – fake software install directory
  • module_installdir – fake module install directory
easybuild.tools.build_log.dry_run_warning(msg, *args, **kwargs)

Print dry run message.

easybuild.tools.build_log.init_logging(logfile, logtostdout=False, silent=False, colorize='auto', tmp_logdir=None)

Initialize logging.

easybuild.tools.build_log.log_start(log, eb_command_line, eb_tmpdir)

Log startup info.

easybuild.tools.build_log.print_error(msg, *args, **kwargs)

Print error message and exit EasyBuild

easybuild.tools.build_log.print_msg(msg, *args, **kwargs)

Print a message.

  • log – logger instance to also message to
  • silent – be silent (only log, don’t print)
  • prefix – include message prefix characters (‘== ‘)
  • newline – end message with newline
  • stderr – print to stderr rather than stdout
easybuild.tools.build_log.print_warning(msg, *args, **kwargs)

Print warning message.

easybuild.tools.build_log.raise_easybuilderror(msg, *args)

Raise EasyBuildError with given message, formatted by provided string arguments.

easybuild.tools.build_log.raise_nosupport(msg, ver)

Construct error message for no longer supported behaviour, and raise an EasyBuildError.

easybuild.tools.build_log.stop_logging(logfile, logtostdout=False)

Stop logging.


Return string representing amount of time that has passed since specified timestamp

Parameters:start_time – datetime value representing start time
Returns:string value representing amount of time passed since start_time; format: “[[%d hours, ]%d mins, ]%d sec(s)”