TREEcg / event-stream-client

Deprecated! Use the rdf-connect/ldes-client instead
https://github.com/rdf-connect/ldes-client
Other
14 stars 9 forks source link

feat: Add logging functionality #55

Closed woutslabbinck closed 2 years ago

woutslabbinck commented 2 years ago

It is now possible with option loggingLevel error to only print error messages an not print the info messages by the default. The format has also changed a tiny bit, but if necessary it can be reverted.

Current format:

[2021-12-13T10:46:39.042Z]  INFO: GET https://apidg.gent.be/opendata/adlib2eventstream/v1/dmg/objecten

New format:

2021-12-13T10:46:39.042Z [EventStream] info GET https://apidg.gent.be/opendata/adlib2eventstream/v1/dmg/objecten

where the info is green image

KasperZutterman commented 2 years ago

@woutslabbinck @ddvlanck Is it an idea to merge the functionalities of https://github.com/TREEcg/event-stream-client/pull/55/files#diff-2bef2fd99182122dea7001da7d9811efdcafb74c68bfa40d0bece04613aa5554 and https://github.com/TREEcg/types/blob/main/lib/utils/Logger.ts (the Logger utility inside treecg/types)? This way the treecg/types logger could be used everywhere.

woutslabbinck commented 2 years ago

@woutslabbinck @ddvlanck Is it an idea to merge the functionalities of https://github.com/TREEcg/event-stream-client/pull/55/files#diff-2bef2fd99182122dea7001da7d9811efdcafb74c68bfa40d0bece04613aa5554 and https://github.com/TREEcg/types/blob/main/lib/utils/Logger.ts (the Logger utility inside treecg/types)? This way the treecg/types logger could be used everywhere.

That would make sense. That way, the LDES event stream client would not need its own logger file

woutslabbinck commented 2 years ago

@brechtvdv Is it okay to merge for you?

brechtvdv commented 2 years ago

Why is a logger provided inside @treecg/types and not in a separate repo?

pietercolpaert commented 2 years ago

This is stale → what’s the progress on this?

woutslabbinck commented 2 years ago

This branch made the logging functionality of the LDES client configurable. Therefore, it uses the logger from @treecg/types. Brecht asked why this is implemented there and not a separate repository. I just used the logger that was already available in @treecg/types (created by Dwight and modified by myself). I can make a new repository just for the logging functionality within @treecg, but I don't think it would make that much difference (might even be worse as some projects, like bucketizer, were already using that logger)