Skip to content

Normalize logging #127

Description

@schneems

Right now logging is all over the place.

Here's an example:

rundoc.require: Done executing "../../shared/delete_your_app.md", putting contents into document
rundoc.require: Done executing "../next_steps.md", putting contents into document
Running ensure_later block in /private/var/folders/yr/yytf3z3n3q336f1tj2b2j0gw0000gn/T/d20260519-92973-lnyk0u/ruby-getting-started:
apps = run!("heroku apps --json | jq -r '.[].name'")
if apps.include?(app_name)
  puts "Cleaning up app `#{app_name}`"
  run!("heroku apps:destroy #{app_name} --confirm #{app_name}")
else
  puts "Cleanup: Assuming `#{app_name}` deleted already. App name not found in:\n#{apps}"
end
Running `heroku apps --json | jq -r '.[].name'`
Command `heroku apps --json | jq -r '.[].name'` output:
ansi-styled-logs

And

rundoc.require: Done executing "./erb_helpers.md", quietly
Running: ENV["TERM"] = "dumb" # https://github.com/heroku/cli/issues/3598
email = ENV['HEROKU_EMAIL'] || `heroku auth:whoami`.strip

In this case the Running ENV[ output comes from a rundoc.configure block, but you wouldn't know that by looking at the log.

What I would like to see is a "bullet stream" https://github.com/heroku-buildpacks/bullet_stream style output that is consistent. Outputting the command being executed should (mostly) come from the top-level executor, and not from individual commands. It should be clear what output a command should print. The injected IO object should control formatting (indentation etc) such that it's visually clear what output comes from inside a command versus the top level flow.

Ideally, we can trace the flow of documents as we read the log, both document name and line numbers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions