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

Event Logging other than event id 1000 #352

Closed
MarcRohrer opened this issue Jul 12, 2023 · 7 comments
Closed

Event Logging other than event id 1000 #352

MarcRohrer opened this issue Jul 12, 2023 · 7 comments

Comments

@MarcRohrer
Copy link

Hi,

I would like to write specific event ids to be able to easily identify the problem when something goes wrong. The standard id 1000 works flawlessly, but eg.

log.info('beginning of program, initializing...', 1001)

results in windows popping up a message that the program wants to change the system for a user defined event and no entry is written.

I am not sure, if I am doing something wrong...
maybe?

Thanx!

Marc Rohrer

@coreybutler
Copy link
Owner

Truthfully, I'm not sure why this would be failing. The event logging code was written a very long time ago, and it worked with custom IDs... but I haven't tested it in a very long time.

The only thing I can think of is the encoding. The event ID may need to be a Uint32, which JS won't handle by default. That's just a guess though. Unfortunately, I do not have time to look into this, so I'll mark it as "help wanted".

@miquelfire
Copy link

Looking at how events are created in the code, I saw it used eventcreate. Looking at the docs, I noticed something that might be key: It seems the ID can only be between 1 and 1000.

From here

/id <eventID> Specifies the event ID for the event. A valid ID is any number from 1 to 1000.

@MarcRohrer
Copy link
Author

Interesting, but very strange. In my event log, I see tons of event ids higher than 1000.
Maybe a limitation of eventcreate.
But for differentiaton purposes, the absolute value does not really matter, I guess, as the id is to be interpreted in relation to the event source, right?
I checked with 700, which worked fine.
You might consider adding to the documentation:

a) eventcreate is used under the hood
b) this limits a custom event id to an unsigned int < 1000

Thank you very much for your input!

@miquelfire
Copy link

It would be int <= 1000

@coreybutler
Copy link
Owner

I just added notes about this to the README.

@MarcRohrer
Copy link
Author

@miquelfire: so the id can be negative also?
according to the first post by [coreybutler] the expected data type is Uint32. So this shouldn't really work.
As the default is 1000, a custom value would be something other than 100, wouldn't it?

@coreybutler: future users will thank you for that :-)

@miquelfire
Copy link

The valid values are 1 to 1000. I assume if there was direct access to the event log API instead of using eventcreate, we could use higher values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants