Skip to content

build_log

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

Authors:

  • Stijn De Weirdt (Ghent University)
  • Dries Verdegem (Ghent University)
  • Kenneth Hoste (Ghent University)
  • Pieter De Baets (Ghent University)
  • Jens Timmerman (Ghent University)

EasyBuildError

Bases: LoggedException

EasyBuildError is thrown when EasyBuild runs into something horribly wrong.

__init__(msg, *args)

Constructor: initialise EasyBuildError instance.

__str__()

Return string representation of this EasyBuildError instance.

EasyBuildLog

Bases: FancyLogger

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

caller_info()

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)

PARAMETER DESCRIPTION
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')

DEFAULT: None

more_info

additional message with instructions where to get more information

DEFAULT: None

silent

stay silent (don't print deprecation warnings, only log them)

DEFAULT: False

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.

dry_run_msg(msg, *args, **kwargs)

Print dry run message.

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.

PARAMETER DESCRIPTION
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

dry_run_warning(msg, *args, **kwargs)

Print dry run message.

init_logging(logfile, logtostdout=False, silent=False, colorize=fancylogger.Colorize.AUTO, tmp_logdir=None)

Initialize logging.

log_start(log, eb_command_line, eb_tmpdir)

Log startup info.

print_error(msg, *args, **kwargs)

Print error message and exit EasyBuild

print_msg(msg, *args, **kwargs)

Print a message.

PARAMETER DESCRIPTION
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

print_warning(msg, *args, **kwargs)

Print warning message.

raise_easybuilderror(msg, *args)

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

raise_nosupport(msg, ver)

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

stop_logging(logfile, logtostdout=False)

Stop logging.

time_str_since(start_time)

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

PARAMETER DESCRIPTION
start_time

datetime value representing start time

RETURNS DESCRIPTION

string value representing amount of time passed since start_time; format: "[[%d hours, ]%d mins, ]%d sec(s)"