Skip to content

Refactor loggers to enable easier exception handling #1766

Open
@Gedochao

Description

@Gedochao

What is the problem?
Our loggers currently have comprehensive stacktrace printing and exception handling for BuildException only, which excludes non-build-related throwables. We should be able to handle those as well, to simplify error handling in the cli layer.

def log(ex: BuildException): Unit

Additionally, our naming for different verbosity levels is slightly off. For example, it requires deeper code knowledge to know the difference between logger.log and logger.message.

def message(message: => String): Unit

logger.message should probably be named logger.warn.
a more standard logging level should probably be in place. For example, we could mimic Log4j's levels, having:

  • trace
  • debug
  • info
  • warn
  • error
  • fatal
  • log

Additional context
Inspired by #1760 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    DXDev experienceinternalInternal or build-related changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions