Show @debug log in gitgub actions CI when activated

Github actions allow debug logging that can be enabled here:

I want to setup my CI.yml file to also show the @debug message. I added these 3 lines for this:

name: CI
on:
  push:
    branches:
      - main
    tags: ['*']
  pull_request:
concurrency:
  # Skip intermediate builds: always.
  # Cancel intermediate builds: only if it is a pull request build.
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
  test:
    name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
    runs-on: ${{ matrix.os }}
    continue-on-error: ${{ matrix.version == 'nightly' }}
    strategy:
      fail-fast: false
      matrix:
        version:
          - '1'
          - '1.10'
          - 'nightly'
        os:
          - ubuntu-latest
        arch:
          - x64
    steps:
      - name: Set JULIA_DEBUG environment variable # new line!
        if: ${{ runner.debug == '1' }}             # new line!
        run: echo "JULIA_DEBUG=all" >> $GITHUB_ENV # new line!
      - uses: actions/checkout@v2
      - uses: julia-actions/setup-julia@v1
        with:
          version: ${{ matrix.version }}
          arch: ${{ matrix.arch }}
      - uses: julia-actions/cache@v1
      - uses: julia-actions/julia-buildpkg@v1
      - uses: julia-actions/julia-runtest@v1
      - uses: julia-actions/julia-processcoverage@v1
      - uses: codecov/codecov-action@v4
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          fail_ci_if_error: false 

it works well but big objects like vectors are truncated, similar to the default behaviour of the REPL:

julia> A = collect(1:1000)
1000-element Vector{Int64}:
    1
    2
    3
    ⋮
  999
 1000

Is there a way to pass the show_limited=false argument of ConsoleLogger in the CI.yml file ?

1 Like

So the debug macro is:

@debug(message, value...)

I solve the issue by inserting all my values in the message argument (using string interpolation with $) instead of value args. In my case it was a dictionary named info with many Vector{Float64} values inside. I created this function:

function info2debugstr(info)
    mystr = "Content of info dictionary:\n"
    for (key, value) in info
        mystr *= "  :$key => $value\n"
    end
    return mystr
end

and used it with:

@debug(info2debugstr(info))