Skip to content

[πŸš€ Feature]: [rust] Simplify Selenium Manager output to a single human/application toggleΒ #17748

Description

@titusfortner

Description

Selenium Manager's --output flag has grown by accretion (logger β†’ json/shell β†’ mixed) into four modes that aren't four distinct use cases β€” they're two use cases with duplicates, and none of them provides the behavior conventionally expected of a CLI tool:

--output stdout stderr Notes
logger β€’ result + logs (text)
β€’ Streamed
nothing β€’ Default
shell β€’ result + INFO logs (text)
β€’ Streamed
β€’ logged errors (text)
β€’ Streamed
β€’ Not currently used
β€’ WARN/DEBUG/TRACE logging completely dropped, always (even with --debug)
json β€’ result + logs (JSON)
β€’ Buffered
nothing β€’ java, py, rb, js (pending #13989)
β€’ A crash can lose all logs
β€’ result.message intended as the failure reason, but holds the last non-path INFO/ERROR log, even on success
mixed β€’ result (JSON)
β€’ Buffered
β€’ logs (text)
β€’ Streamed
β€’ .NET
β€’ error field always holds the last non-path INFO/ERROR log, even on success
Proposed CLI default β€’ result (text)
β€’ Buffered
β€’ logs (text)
β€’ Streamed
β€’ Follows standard conventions
Proposed Bindings default β€’ result (JSON)
β€’ Buffered
β€’ logs (JSON)
β€’ Streamed
β€’ Follows standard conventions
β€’ Error information not included in result but obtained from exit code

I uncovered this issue trying to figure out how to emit a notice about what data is getting sent to Plausible. There is no way to do it that works properly in all the --output modes we support because it conflates concerns that should be independent.

Proposal

Deprecate the --output toggle and replace with an audience target toggle β€” human vs application β€” with one consistent discipline underneath:

  1. Result β†’ stdout, all diagnostics β†’ stderr, always. Not a per-mode choice.
  2. One toggle selects only the payload shape on stdout: human-readable text (default) vs structured (JSON). (logger/shell collapse into human; json/mixed collapse into application.)
  3. Model the result as data, not a constant-prefixed log line β€” emit driver_path/browser_path directly.
  4. Failure is the exit code β€” the reason is logged to stderr (shown to a CLI user, replayed by a binding), never scraped into the result payload.
  5. Application mode streams logs on stderr, leaving stdout as the clean result document β€” and those streamed logs should be structured (one JSON object per line, e.g. {"level","timestamp","message"}) so bindings can replay them without each writing a text parser.

Relevant context / related issues

Have you considered any alternatives or workarounds?

Fix the current --output modes in place rather than adding a new flag. Rejected because --output json/mixed are a consumed contract β€” Java/Python/Ruby/JS/.NET parse their exact shape β€” so changing their behavior in place breaks every binding at once. A new flag lets --output keep working through a deprecation window while bindings migrate deliberately. (Selenium Manager is in beta, so flags may change without guarantee, but a deprecation notice on --output still makes the migration explicit rather than silent.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-managerSelenium ManagerC-dotnet.NET BindingsC-javaJava BindingsC-nodejsJavaScript BindingsC-pyPython BindingsC-rbRuby BindingsI-enhancementSomething could be better

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions