Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with nonstandard log level due to BenchmarkTools #28

Open
gdalle opened this issue Jun 8, 2023 · 1 comment
Open

Error with nonstandard log level due to BenchmarkTools #28

gdalle opened this issue Jun 8, 2023 · 1 comment

Comments

@gdalle
Copy link

gdalle commented Jun 8, 2023

I have a package where the CI uses BenchmarkTools.jl, and there is some logging with level -1 (see log level definition and log message generation).
This causes an error because only standard log levels are taken into account for the GitHub action (see CI log).

ERROR: LoadError: MethodError: no method matching *(::String, ::Nothing)

Closest candidates are:
  *(::Any, ::Any, ::Any, ::Any...)
   @ Base operators.jl:578
  *(::Union{AbstractChar, AbstractString}, ::Union{AbstractChar, AbstractString}...)
   @ Base strings/basic.jl:260
  *(::Union{AbstractChar, AbstractString}, ::Missing)
   @ Base missing.jl:183
  ...

Stacktrace:
  [1] command(cmd::Nothing, props::NamedTuple{(:file, :line), Tuple{String, Int64}}, val::String)
    @ GitHubActions ~/.julia/packages/GitHubActions/DMn4Q/src/GitHubActions.jl:66
  [2] handle_message(::GitHubActions.GitHubActionsLogger, level::Base.CoreLogging.LogLevel, msg::String, _module::Module, group::Symbol, id::Base.UUID, file::String, line::Int64; location::Nothing, kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:progress,), Tuple{Float64}}})
    @ GitHubActions ~/.julia/packages/GitHubActions/DMn4Q/src/GitHubActions.jl:250

I believe the culprit is this block of code, which needs an else otherwise cmd might be nothing:

else
cmd = if level === Debug
"debug"
elseif level === Warn
"warning"
elseif level === Error
"error"
end
command(cmd, (file=file, line=line), message)

@gdalle
Copy link
Author

gdalle commented Jun 8, 2023

Edit: this issue appears to be the same as #16. It will be solved by #25

@gdalle gdalle changed the title Error with nonstandard log level Error with nonstandard log level due to BenchmarkTools Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant