ox_lib icon indicating copy to clipboard operation
ox_lib copied to clipboard

[Suggestion] Custom Event Attributes

Open ghost opened this issue 2 years ago • 0 comments

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 avatar Jul 07 '23 03:07 ghost