Skip to content

Wasm - access to browser console (question) #73

Closed

Description

@zbigniew-gajewski

Is it possible to get access to browser console from Uno/Wasm (Shared) project in order to write custom message somewhere in code? At the moment I am throwing an exception with custom message which allow me to somehow 'mimic debugging', but it is quite cumbersome (requires often recompilation).

Activity

  1. jeromelaban commented on Jun 27, 2018

    @jeromelaban
    Member

    There are two ways to do that:

    • Console.WriteLine
    • The Uno logging, using this initialization and use this.Log().Debug("my message") to log.
  2. added
    question
    on Jun 27, 2018
  3. zbigniew-gajewski commented on Jun 27, 2018

    @zbigniew-gajewski
    Author
    1. Console.WriteLine works - Thanks!

    2. After adding logging code to App.xaml.cs and reloading page, the browser console shows:

    WASM doesn't support threading / Thread creation failed:

    image

  4. jeromelaban commented on Jun 27, 2018

    @jeromelaban
    Member

    This is an issue with the latest versions (2.0+) of microsoft's logging extensions. Use the version 1.1.1 instead, which does not use threads to log.

  5. zbigniew-gajewski commented on Jun 27, 2018

    @zbigniew-gajewski
    Author

    Works now! Thanks for help!

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

    question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions