Skip to content

runc debug log file paths and function names are too long #3184

@kolyshkin

Description

@kolyshkin

PR #2911 enabled logrus to show information about log
caller, if --debug is set.

The problem is, the file name and in many cases the function name have a
long prefix of github.com/opencontainers/runc (this is with -trimpath used
during compilation, and without it it's even worse).

Here's how it looks like:

$ runc --debug run x
ERRO[0000]github.com/opencontainers/runc/utils.go:61 main.fatalWithCode() JSON specification file config.json not found

It is worse when log is printed not from the main package:

INFO[0000]github.com/opencontainers/runc/libcontainer/specconv/spec_linux.go:350 github.com/opencontainers/runc/libcontainer/specconv.createLibcontainerMount() cgroup data: %snsdelegate                    

Ideally, it should look like:

$ runc --debug run x
ERRO[0000]utils.go:61 main.fatalWithCode() JSON specification file config.json not found
INFO[0000]libcontainer/specconv/spec_linux.go:350 libcontainer/specconv.createLibcontainerMount() cgroup data: %snsdelegate                    

Note all this happens only when --debug is given.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions