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

[Suggestion] Custom Event Attributes #365

Open
ghost opened this issue Jul 7, 2023 · 0 comments
Open

[Suggestion] Custom Event Attributes #365

ghost opened this issue Jul 7, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@ghost
Copy link

ghost commented Jul 7, 2023

Describe the solution you'd like
I'd like to see a feature added to the logger to be able to add custom event attributes.
https://i.imgur.com/73mVJDg.png
https://i.imgur.com/voxSfes.png

Additional context
Not sure the best way to implement, probably easiest to maintain backwards compat to convert lib.logger to take a table instead of source, event, message and then can check arguments to see if it needs to use old format or new format.

Ex.
lib.logger({
source = 1,
event = 'event-manager',
message = 'a string here for the message',
attributes = {
playerName = charName,
serverInfo = {
ip = '0.0.0.0',
name = 'test-server',
}
},
tags = {
['license'] = 'license:teofeonewfefwinefw' -- either this or tags just takes a table of strings, doesn't really matter.
}
})

and then in your logger file something to insert the values from attributes into buffer[bufferSize], either by looping or some table magic.

@ghost ghost added the enhancement New feature or request label Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

0 participants