Skip to content

New lines don't display for logs #448

Open

Description

@odyfey

New lines are skipped when displaying logs. The example below shows the output of running the ansible playbook:

Details Image

If you copy the output into an editor, the logs with newline translation will look more clear:

Details Image

PR 291 implemented similar functionality for displaying errors. Could the same be done for logs?

Activity

  1. bgentry commented on Oct 28, 2025

    @bgentry
    Contributor

    Can you share a bit more about how you're running the library or if you're using its prebuilt binaries? This looks like potentially something is incorrect with the slog logger being used, but it doesn't map to what I've seen locally or in apps where I've embedded the riverui handlers.

  2. odyfey commented on Oct 28, 2025

    @odyfey
    Author

    RiverUI is running in a docker container with an image ghcr.io/riverqueue/riverui:0.13.0

    slog middleware configuration:

    rlogmw := riverlog.NewMiddleware(func(w io.Writer) slog.Handler {
    	return slog.NewTextHandler(w, &slog.HandlerOptions{
    		AddSource: opts.AddSource,
    		Level: opts.Level,
    		ReplaceAttr: replacer,
    	})
    }, nil)

    using a logger in a worker:

     riverlog.Logger(ctx).InfoContext(ctx, "any text")
  3. Cyberax commented on Oct 29, 2025

    @Cyberax

    Can you share a bit more about how you're running the library or if you're using its prebuilt binaries?

    I'm seeing the same issue. The <code> block doesn't have styles to preserve the newlines:

    Image

    If I manually change the DOM node type from <code> to <pre> directly in the inspector, then the logs appear normally:

    Image

    I'm using the built-in UI, package version is riverqueue.com/riverui v0.13.0

  4. jwarner112 commented on Jun 11, 2026

    @jwarner112

    This issue is caused by using only the <code> html tag for this element, which forcibly strips all whitespace. Wrapping it in a <pre> tag preserves said whitespace. This is noted and resolved with a small tweak in #530

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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