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

Allow ANSI codes to be disabled for syslog. #261

Closed
geiseri opened this issue Dec 23, 2021 · 7 comments
Closed

Allow ANSI codes to be disabled for syslog. #261

geiseri opened this issue Dec 23, 2021 · 7 comments
Assignees
Labels
done The underlying issue has been fixed enhancement New feature or request
Milestone

Comments

@geiseri
Copy link

geiseri commented Dec 23, 2021

If you can make:
hasp_debug.cpp:29 publicly mutable then rsyslog output can disable the ansi codes. These codes seem to confuse rsyslog.

@geiseri geiseri changed the title Allow asni codes to be disabled for syslog. Allow ANSI codes to be disabled for syslog. Dec 23, 2021
@fvanroie fvanroie added the enhancement New feature or request label Dec 28, 2021
@fvanroie fvanroie self-assigned this Dec 28, 2021
@fvanroie fvanroie added this to the 0.7.x milestone Dec 28, 2021
fvanroie added a commit that referenced this issue Dec 31, 2021
@fvanroie fvanroie added the done The underlying issue has been fixed label Dec 31, 2021
@fvanroie
Copy link
Collaborator

Thanks for reporting! I've added a checkbox for the ANSI codes to the Debug Settings.

@fvanroie
Copy link
Collaborator

fvanroie commented Jan 2, 2022

I've added the option to v0.7.0-dev test build which is available from the Actions tab. Could you test it please and report if this fixes your issue?

@geiseri
Copy link
Author

geiseri commented Jan 4, 2022

Better, the ansi is now fixed. It seems the syslog format is malformed. let me investigate, i am using rsyslog on debian here.

@fvanroie
Copy link
Collaborator

fvanroie commented Jan 4, 2022

Okay thank you. That would not surprise me... I've minimally tested this feature using Visual Syslog Server, so any feedback to improve compatibility/compliance will be greatly appreciated.

@geiseri
Copy link
Author

geiseri commented Jan 10, 2022

I was looking at the logging code. Would you have an issue if I removed the internal version of Arduino-Log (thijse/ArduinoLog) and used the version from platformio? I was looking at nomis/uuid-syslog but it uses its own logging system that looks pretty new and not used outside of his projects. Syslog is a handy format for network devices, but the protocol is twitchy as hell once structured text is in play. How big of a PR would you be willing to entertain if it ends up touching a few files?

@fvanroie
Copy link
Collaborator

The Arduino-Log (thijse/ArduinoLog) used in openHASP is a modified version of the library to be able to log the same message to different streams (Telnet, Console & syslog) at once. So, a remove/replace with the official code will certainly break things. It's not a very big modification, so I could probably backport if the new version has other advantages.

The syslog code I use is based on the ArduinoLog flow, so that it can act as a sort of serial port. If I remember correctly, it was based on this video.

@fvanroie
Copy link
Collaborator

Better, the ansi is now fixed. It seems the syslog format is malformed. let me investigate, i am using rsyslog on debian here.

If the ANSI is OK, I think we can close this issue. For malformed syslog messages, we can open a new one if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done The underlying issue has been fixed enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants