matrix-js-sdk icon indicating copy to clipboard operation
matrix-js-sdk copied to clipboard

Debuglog as events

Open FlyveHest opened this issue 3 years ago • 5 comments

Changed debuglog in sync module to be user configurable via debugLogType option given to createClient call.

Can be one of

  • 'stdout' : Default if not specified, behaves as module has always done, outputting debug logging to console
  • 'event' : Emits a debuglog event with string to be logged as data, so the client can incorporate debug logging into their own logging framework, if they so wish
  • 'off' : Turns off debugloggin in sync module

Signed-off-by: Peter Reinhold [email protected]


This change is marked as an internal change (Task), so will not be included in the changelog.

FlyveHest avatar Feb 21 '21 12:02 FlyveHest

@FlyveHest, please include a sign-off as described here

SimonBrandner avatar Feb 21 '21 12:02 SimonBrandner

@FlyveHest, please include a sign-off as described here

Is editing the PR text sufficient?

FlyveHest avatar Feb 21 '21 12:02 FlyveHest

@FlyveHest, yes! :+1:

SimonBrandner avatar Feb 21 '21 12:02 SimonBrandner

Mostly because with my, at the time, more limited exposure to the SDK, hadn't seen the output issue elsewhere.

It seems like debug logging has been up to the individual part developers, as there are multiple ways of doing it, depending on where in the project you are.

I recently got encryption working, and got a ton of debug noise there as well, and the way its implemented there is different than in the sync module.

But, i'll try and take a look at a broader scope when I have some more time.

If this PR is rejected, it would be really nice if DEBUG could be set to false in the committed code, at least. (Personal opinion)

FlyveHest avatar Feb 27 '21 18:02 FlyveHest

Slightly related to https://github.com/vector-im/element-web/issues/21532

MadLittleMods avatar Jun 02 '22 18:06 MadLittleMods

It looks to me like this PR isn't really going anywhere, so I'm going to go ahead and close it, though I certainly agree that better control over the logging is required. https://github.com/matrix-org/matrix-js-sdk/issues/1970 is maybe a better tracker for this.

richvdh avatar Oct 02 '23 18:10 richvdh