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

[Proposal] add LogFormat static property #1469

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Commits on Jun 25, 2024

  1. Proposal: add LogFormat static property

    A large amount of time spent when maintaining the RxPlayer is actually
    spent on debugging device-specific issues.
    
    Consequently, we beefed-up our debugging capabilities: we added a LOT of
    logs, developed [our own specialized remote
    debugger](https://github.com/canalplus/RxPaired/) so we can be
    monitoring low-end devices for a long amount of time (unlike chrome's or
    webkit's debugger), developed some reverse-engineering tools as well as
    (closed-source) visual logging tools.
    
    Now that we have many tools at our disposition, I see that our regular
    logs (that can e.g. be produced by calling `RxPlayer.LogLevel =
    "DEBUG"`) - the most relied on way by application developpers - are
    lacking.
    
    The most evident lacking data is some kind of timestamp, to better
    understand time-related issues, which are frequent.
    
    But more than that, there's a lot of comfort in being able to rely on our
    aforementioned RxPaired remote debugger, so I was wondering if we could
    allow the production of logs in a format that could be easily imported by
    it.
    
    Hence the idea of a supplementary `RxPlayer.LogFormat` property.
    It is by default set to `"standard"` - which is the currently-existing
    format, but can also be set to the RxPaired-compatible `"full"` format
    which:
    
      - Immediately produces the `[Init]` log, which today only serves to
        provide a way to convert between date representations (date on the
        device or monotonic timestamp since the page was opened) inside
        RxPaired (and also ultimately perform protocol version detection).
    
      - Prepend each log with a timestamp and the "namespace" of the log
        (e.g. `[error]` for error logs).
    
    Here, we could tell application developpers not only to call:
    ```js
    RxPlayer.LogLevel = "DEBUG";
    ```
    
    But also:
    ```js
    RxPlayer.LogLevel = "full";
    ```
    
    When the idea is about communicating logs to us (if they just want to
    display logs for initial debugging steps of an issue potentially on
    their side or the content's side, the `"standard"` format may be clearer
    to them as less verbose).
    peaBerberian committed Jun 25, 2024
    Configuration menu
    Copy the full SHA
    52ec6e1 View commit details
    Browse the repository at this point in the history