Commit graph

7 commits

Author SHA1 Message Date
Rey Tucker
78286d47f9 host: common: add log_get_verbosity function
log_get_verbosity returns the current logging level, which may be useful
for situations where a lot of processing is required for verbose
logging, etc.
2018-08-01 16:24:54 -04:00
Michael Ambrus
344d497cb2 libbladeRF: Added syslog support (Linux, OSX)
OpenBTS and YateBTS fork a transceiver sub-process and redirect stderr
and stdout, which effectively hide any bladerf logs. For debugging
time-critical code, printf debugging (or logging) is simple, yet
practically essential. libbladeRF logging via syslog is opt-in via the
CMake ENABLE_LIBBLADERF_SYSLOG option, which defaults to OFF.

To make this as transparent as possible, a generic mechanism for
initializing libraries without having to use any specific pre-known
function has been introduced (see init_fini.c). Currently its only real
purpose is to closelog() upon unloading library. Failing doing this is
an error affecting the case when the library is unloaded manually.

When the syslog support is enabled, the libbladeRF default log level is
reduced to WARNING, rather than INFO to avoid noise in logs.
2015-01-14 14:20:13 -05:00
Jon Szymaniak
625694eaa5 license: License changes on various portions of the codebase
Where possible (and with contributor permission), items have been
changed to LGPLv2.1 or MIT licenses to avoid issues with any proprietary
libraries from vendors (HDL and FW), allow static linking (with headless
mode operation in mind), and to generally present users with more
permissive licenses.

File headers and the COPYING have been updated accordingly. Third party
sources have been either removed, replaced, or relocated in the source
tree, in accordance with the licenses decided upon for each part of the tree.

Contributor Assignment Agreements have been added, and it is required
that these be submitted before significant patches and pull requests
are accepted.
2013-10-27 00:17:35 -04:00
Jon Szymaniak
7a1b2c1462 common, libbladeRF: log.c support can be disabled at compile-time
CMake option added to disable log.c for libbladeRF. Adjustments made
to other files as needed to address warnings (becoming errors via
-Werror and /Wx).

Removed return values for log-related functions, as these were unused
and made it slightly more annoying to make this change. The libbladeRF
minor version has been bumped to note this change in the currently
unstable series v0.x.x series.
2013-10-21 22:44:59 -04:00
Jon Szymaniak
2dcae9eeb2 libbladeRF & common: Renamed logging routines to address conflicts
The common logging functions have been renamed in order to not
conflict with the library's bladerf_log_set_verbosity().
2013-09-11 00:29:14 -04:00
Brian Padalino
06256f2d8c common: Default to VERBOSE logging for now. 2013-09-07 13:26:14 -04:00
Frank Jenner
3655b3d516 Added variable-level logging mechanism
Added a mechanism to log messages with different priority levels, and to
filter which messages are output by setting a threshold level. The
function to set the current log level/verbosity is exposed through
libbladeRF.h, while the logging function/macros themselves are private
to this project, and are present in log.c/log.h. Callers should use the
convenience macros bladerf_log_[level]() to issue their log messages.
These macros piece together a format string that contains the message
priority and, for warning and higher priorities, the function and line
number on which the message was logged. Also, warning level and higher
level messages are output to stderr, rather than stdout.
2013-09-02 15:39:41 -04:00