Another new release today, version 2.0.0 of luasyslog.
The luasyslog project was abandoned, only a rock archive at LuaRocks remained. So I created a new repo, imported and updated the code, and this is the result.
Changes:
- most changes are Lua 5.1/2/3/4 updates
- no longer rely on globals (only on Lua 5.1 lsyslog sets a global)
- added standard lualogging formatting options
- syslog now returns a module, same as lsyslog
- added tests and CI
- it requires lualogging 1.4+
Installation is easiest via LuaRocks.
New homepage: https://github.com/lunarmodules/luasyslog
If there are any issues, please let me know.
Thijs
|
Il giorno mar, 23/03/2021 alle 00.24 +0000, Thijs Schreijer ha scritto:
> Another new release today, version 2.0.0 of luasyslog. > > The luasyslog project was abandoned, only a rock archive at LuaRocks remained. > So I created a new repo, imported and updated the code, and this is the > result. Hi Thijs, I needed syslog support years ago and I started a similar project: https://github.com/ntd/luasyslog > ... > If there are any issues, please let me know. I've been pointed out that passing a "perishable" string to `openlog` could led to memory corruption because on some systems that pointer is cached. I solved by applying the following patch: https://github.com/ntd/luasyslog/commit/95bdbd389e207931a9c75a8c4d800129b88c690 Ciao. -- Nicola |
It was thus said that the Great Fontana Nicola once stated:
> Il giorno mar, 23/03/2021 alle 00.24 +0000, Thijs Schreijer ha scritto: > > > > If there are any issues, please let me know. > > I've been pointed out that passing a "perishable" string to `openlog` > could led to memory corruption because on some systems that pointer is > cached. I solved by applying the following patch: > > https://github.com/ntd/luasyslog/commit/95bdbd389e207931a9c75a8c4d800129b88c690 I solved that issue by saving the ident string in the Lua registry, and removing it when calling the wrapper for closelog(). -spc |
@Nicola thx for the heads up, sorry to see I missed your work, could have saved me some.
@Sean I like the registry usage, but was wondering; shouldn’t “close” be called when the library unloads (Lua terminates)? The docs explicitly mention dynamically loaded libraries, and the need to call “close” on unloading.
Thijs
PS. Link referencing the issue: https://www.gnu.org/software/libc/manual/html_node/openlog.html
|
It was thus said that the Great Thijs Schreijer once stated:
> On 23 Mar 2021, at 09:09, Sean Conner <[hidden email]<mailto:[hidden email]>> wrote: > > I solved that issue by saving the ident string in the Lua registry, and > removing it when calling the wrapper for closelog(). > > @Sean I like the registry usage, but was wondering; shouldn’t “close” be > called when the library unloads (Lua terminates)? The docs explicitly > mention dynamically loaded libraries, and the need to call “close” on > unloading. Possibly. I think closelog() was just added as a complement to logopen()---I've certainly never called closelog(), but I suppose there *might* be some systems out there where the OS cannot reclaim resources upon program exit and still have syslog(). -spc |
In reply to this post by Fontana Nicola
>> ... >> If there are any issues, please let me know. > > I've been pointed out that passing a "perishable" string to `openlog` > could led to memory corruption because on some systems that pointer is > cached. I solved by applying the following patch: > > https://github.com/ntd/luasyslog/commit/95bdbd389e207931a9c75a8c4d800129b88c690 > > Ciao. > — > Nicola > Fixed now, just pushed version 2.0.1. Thx again! Thijs |
Free forum by Nabble | Edit this page |