summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* NEWS: Finalise for 0.2.1libumberlog-0.2.1Gergely Nagy2012-05-021-1/+7
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Mention docutils in the READMEGergely Nagy2012-04-291-1/+3
| | | | Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
* Reduce the number of memory allocationsGergely Nagy2012-04-291-14/+32
| | | | | | | | Make the string escape use an ul_buffer_t, to avoid unnecessary memory allocations. This greatly reduces the number of mallocs made, and thus results in a noticable increase in speed. Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
* Generate the manual page if rst2man is presentGergely Nagy2012-04-294-1/+13
| | | | | | | If rst2man is present at configure time, generate the manual page with it, which is to be included in the dist tarball too. Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
* .travis.yml: Install check tooGergely Nagy2012-04-291-1/+1
| | | | Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
* Merge branch 'feature/test-suite/check'Gergely Nagy2012-04-294-36/+60
|\
| * Convert the test suite to CheckGergely Nagy2012-04-294-36/+60
|/ | | | | | | | | | | While assert() is a neat tool, it is not really suitable for testing, as it gives hardly any indication on what part of the test suite failed, and why. For this purpose, an existing testing library, such as Check is a much better option, so lets use that! Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
* Preparations for 0.2.1Gergely Nagy2012-04-283-3/+28
| | | | | | | Bump software and library interface versions, and start adding NEWS entries. Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
* Add the build-status link to README.rstGergely Nagy2012-04-281-1/+3
| | | | Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
* .gitingore: Ignore a few more generated filesGergely Nagy2012-04-281-0/+15
| | | | Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
* Add a closelog() wrapper to clear the environmentGergely Nagy2012-04-285-1/+44
| | | | | | | | | | | | | | | Our openlog() wrapper fills in a couple of variables, and those were kept around even after a closelog(), and thus, affected ul_format() calls even after a closelog(). This in turn, made one of the test cases fail, as that was relying on the default behaviour, which was modified due to an openlog() in an earlier test case. We now wrap closelog() aswell, and NULL out our settings to get a clean state, and add a test case to verify this behaviour aswell. Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
* travis.yml: Use sudo to install dependenciesGergely Nagy2012-04-281-1/+1
| | | | Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
* Add Travis CI control fileGergely Nagy2012-04-281-0/+8
| | | | Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
* Resolve facility & priority properlyGergely Nagy2012-04-202-6/+29
| | | | | | | | | | | | | | | | | | | The priority passed to the syslog() call can contain a facility embedded, so we need to extract it to find both the facility and the priority. This also means that the facility set at openlog()-time can be overridden later, so _find_facility() has to take the priority value into account. This patch makes libumberlog do just the above: extract both priority and facility from the priority passed to syslog(), and if facility is 0, use the default set at openlog()-time, if any. Added a test case to test this expected behaviour. Reported-by: Peter Czanik <czanik@balabit.hu> Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Properly reset the JSON buffer in all cases.Gergely Nagy2012-04-201-2/+2
| | | | | | | | | | | | Previously the JSON buffer was only reset when ul_vformat() was called, but not everything goes through that, so some messages ended up being garbled. The proper thing to do is to reset in _ul_vformat(), as everything goes through that, and that's the right place to do this anyway. Reported-by: Peter Czanik <czanik@balabit.hu> Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* configure.ac: Bump version to 0.2.0libumberlog-0.2.0Gergely Nagy2012-04-161-1/+1
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* NEWS: Finalise for 0.2.0.Gergely Nagy2012-04-161-1/+1
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Free up the JSON buffer on exitGergely Nagy2012-04-161-0/+7
| | | | | | | This adds a destructor that simply frees up the JSON buffer, so that to not upset valgrind and similar tools too much. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Improve string escape performance a littleGergely Nagy2012-04-161-6/+5
| | | | | | | | | | Instead of escaping a string, returning a new one and running strlen() on that, use an output variable to store the length, since we can easily calculate that during the escape process anyway. This should shave off a tiny bit of CPU time. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* .gitignore updateGergely Nagy2012-04-131-0/+1
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Correctly NULL-terminate the JSON buffer in all cases.Gergely Nagy2012-04-131-1/+1
| | | | | | | When finalizing the JSON buffer, always NULL-terminate it at the appropriate length. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Do use the library versionGergely Nagy2012-04-131-2/+3
| | | | | | | | | | We had the LUL_* variables set in lib/Makefile.am, but they weren't used. Now they are. While there, bumped LUL_CURRENT to 1, because of the dropped JSON dependency. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Merge branch 'feature/libc-only'Gergely Nagy2012-04-1310-87/+389
|\
| * NEWS updateGergely Nagy2012-04-131-0/+16
| | | | | | | | | | | | Start adding 0.2.0 news items. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
| * configure updatesGergely Nagy2012-04-131-2/+5
| | | | | | | | | | | | Check for a few more headers, functions and types. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
| * Make json-c optional.Gergely Nagy2012-04-132-1/+5
| | | | | | | | | | | | | | When json-c is not found, instead of failing at configure time, continue, but disable the test suite. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
| * Implement string escaping.Gergely Nagy2012-04-133-8/+166
| | | | | | | | | | | | With this patch, both JSON keys and values will be properly escaped. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
| * Fix ul_buffer_finalize().Gergely Nagy2012-04-131-2/+3
| | | | | | | | | | | | | | ul_buffer_finalize() was off by one, and instead of overriding the trailing ",", it overwrote the trailing nul-byte. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
| * Format JSON ourselves, without json-c.Gergely Nagy2012-04-136-84/+204
|/ | | | | | | | | | | To make the library thinner, we now format JSON ourselves: there was so little we used from json-c, that doing it ourselves is lighter and faster. With this commit, we have the architecture in place, with only a few little things remaining to be done, such as escaping string values. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* t/: Add a new performance test.Gergely Nagy2012-04-132-1/+74
| | | | | | | The new test case always succeeds, it's purpose is to echo the performance results. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* TODO.org: Add a note about removing the json-c dependency.Gergely Nagy2012-04-111-0/+9
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* configure.ac: Bump version to 0.1.2.libumberlog-0.1.2Gergely Nagy2012-04-081-1/+1
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Properly handle va_lists, by copying.Gergely Nagy2012-04-083-6/+117
| | | | | | | | | | | | Up until now, the library abused that passing va_list around without copying works on various architectures. On others, that does not. To remedy the issue, the library now parses format strings itself, and copies va_list. This makes it work on all architectures, independent on the internal implementation of va_list, and preserves both API and ABI. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* TODO.org: Add a note about va_copy()Gergely Nagy2012-04-031-0/+7
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Add the logo to the source tree.libumberlog-0.1.1Gergely Nagy2012-04-025-1/+330
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* 0.1.1 release notes.Gergely Nagy2012-04-022-1/+14
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Override __syslog_chk if present, always.Gergely Nagy2012-04-022-21/+3
| | | | | | | Always override __syslog_chk if it is supported by the system, instead of only overriding it if using fortification. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* NEWS: New filelibumberlog-0.1.0Gergely Nagy2012-03-262-1/+6
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Put the man page in section 3, instead of 1Gergely Nagy2012-03-241-1/+1
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Include the linker script and the API docs in the dist tarball.Gergely Nagy2012-03-241-0/+2
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Fix infinite recursion on FreeBSD.Gergely Nagy2012-03-241-1/+20
| | | | | | | | | | | | | | On FreeBSD, syslog() calls vsyslog(), our own replacement version. So when from syslog(), we call our vsyslog(), which calls the old syslog(), that ends up calling our own vsyslog() again. To work around this issue, use a thread-local static variable that signals whether we're recursing, and if we are, then call the old vsyslog from the new one, thus breaking the loop. This makes the library function correctly on FreeBSD too. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* More portability fixesGergely Nagy2012-03-242-1/+13
| | | | | | | | | | While on glibc-based systems, we need -ldl (for dlopen) and -lrt (for clock_gettime), FreeBSD has both in libc, and does not have these extra libraries. Teach configure about this. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Portability fixesGergely Nagy2012-03-242-5/+5
| | | | | | | | Use _POSIX_HOST_NAME_MAX instead of HOST_NAME_MAX: both Linux and FreeBSD have the former, but FreeBSD does not have HOST_NAME_MAX in limits.h Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* README: Yet more updatesGergely Nagy2012-03-241-26/+25
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* README: Major update.Gergely Nagy2012-03-241-22/+70
| | | | | | A major update, to make it more README-like, and less dry. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Allow compilation with clang, too.Gergely Nagy2012-03-241-0/+2
| | | | | | | Clang tries to expand the syslog and vsyslog macros when we define our overrides. To work around that, #undef them first. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Implement proper error handling.Gergely Nagy2012-03-243-63/+139
| | | | | | | | | | | | | | | | Instead of calling abort() if vasprintf() fails, and ignoring possible errors from the JSON library, do handle errors reasonably sanely: check return values, and return an error state from all functions, and propagate it up to the application level, too. This means that the legacy overrides will silently fail, but set errno appropriately in case serializing to JSON fails, and do what the system libc does with syslog otherwise. The new functions can return NULL or non-zero on error, which the application can then handle as it sees fit. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Mark a few internal functions inline.Gergely Nagy2012-03-241-5/+5
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Fix a formatting mistake in the API docs.Gergely Nagy2012-03-231-2/+2
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* .gitignore: Follow the project renameGergely Nagy2012-03-231-2/+2
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>