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

Improve logging #56

Merged
merged 11 commits into from
Mar 30, 2024
Merged

Improve logging #56

merged 11 commits into from
Mar 30, 2024

Conversation

jubnl
Copy link
Contributor

@jubnl jubnl commented Mar 29, 2024

Log levels implemented:

  • TRACE
  • DEBUG
  • INFO
  • WARN
  • ERROR
  • FATAL

Also made sure that if 2 logs are sent and received at the same time, they will appear on 2 different lines.

The logs are also timestamped.

In the different sendLEVELMessage, you now can add a logger (just a string) to identify what mod, or event different type of logger to identify easily from where the log comes from.

usage example :

sendInfoMessage("My Custom Message", "MyLoggerName")

will print out in the console :

2024-03-29 15:18:18 :: INFO  :: MyLoggerName :: My Custom Message

The logger name is optional and will default to "DefaultLogger" if the argument is not passed.

I'm currently working on a way to exploint the new logger format console side. Specifically 2 filters that will only show logs from a specific level (or from a specific level and above) and filter out only logs from a specific logger

@Aurelius7309
Copy link
Collaborator

Am I correct in thinking this is incomplete as of now? This seems like a great addition!

@jubnl
Copy link
Contributor Author

jubnl commented Mar 29, 2024

This is the 1st advancement before having a proper console. It is missing the console part, which I'm working on at the moment. This part can already be implemented in the main repo imo, so modders (and the Steamodded team) can already utilize the logging part. At the moment, the search part combined with the new logger will already help a lot the devs! The logs already arrives formatted properly in the console with this pr.

I'm rewriting the console from scratch, once I got it working properly with the features mentioned above, I'll push it and create a new pull request if that's ok with you

@Aurelius7309 Aurelius7309 merged commit 14adfea into Steamopollys:main Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants