Commit graph

39 commits

Author SHA1 Message Date
Brent Stapleton
497513c74d log: formatting log.cpp
`clang-format -i --style=file host/lib/utils/log.cpp`
2019-04-11 16:46:05 -07:00
Vidush
682feb3f6c Log: Handle Exceptions in Destructor 2018-06-06 14:58:54 -07:00
Martin Braun
f2e68440d6 log: Allow disabling of fastpath msgs at runtime
- Fixes an issue with compile time disabling as well
- An UHD_LOG_FASTPATH_DISABLE=1 env var will make it that O/U/S/D won't
  be printed
2018-04-26 17:44:49 -07:00
Martin Braun
a061c617de log: Add method for local generation of messages in log.cpp 2018-04-26 17:44:49 -07:00
Vidush
96fa9acb7f logging: Remove dead code from log.cpp 2018-04-26 09:13:20 -07:00
Martin Braun
db942972d3 logging: Fix UHD_LOG_FILE cmake var
- Fixes: cmake -DUHD_LOG_FILE wasn't respected
- Fixes: UHD_LOG_FILE and UHD_FILE_LOG_LEVEL had to both be set for
  either to take effect
- Fixes: Use of unnecessary boost::make_shared<>
- Also factored out setting up console- and file logger into their own
  locations in an attempt to improve readability
2018-04-10 15:17:37 -07:00
Martin Braun
ae5211d71d uhd: Update license headers
All copyright is now attributed to "Ettus Research, a National
Instruments company".

SPDX headers were also updated to latest version 3.0.
2018-02-19 16:54:52 -08:00
Martin Braun
9ab3f807e8 logging: Minor refactoring, skip empty log messages
Empty log messages are now skipped for faster processing. The
'terminating' log message is now also empty (and thus skipped).

Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
2018-01-23 12:35:00 -08:00
Martin Braun
3a995b3553 logging: Fix version print at top of every UHD session 2018-01-18 12:32:05 -08:00
Martin Braun
4f948e2c8b Move all license headers to SPDX format. 2017-12-22 10:45:51 -08:00
Martin Braun
056dabcaf3 log: Removed timeout from logger, replaced with wait.
This works because there's also another trace message on termination of
the logger.
2017-05-23 17:13:40 -07:00
trungnob
6c002e0266 log: Moved print_system_info to log.cpp.
We want to display syteminfo when the log system get initialized.
Also removes a static block.
2017-05-20 21:21:59 -07:00
Martin Braun
412acb8537 log: Split add_logger() out of the main logging header
This way, C++11 features are not required to build with UHD headers
included.
2017-05-12 21:26:01 -07:00
Martin Braun
15f0140cd7 log: Fixed compiler warning 2017-05-03 15:58:55 -07:00
Martin Braun
9830730918 log: Allow logging to block
This means it's very unlikely that logging messages get dropped, but the
downside is that LOG macros can block for up to 250 ms. This is very
unlikely though.
Note that fastpath logging does not have this feature. It's always fast,
and might drop messages.
2017-04-24 14:19:10 -07:00
Martin Braun
0f30ef70f0 log: Moved fastpath logging to its own thread 2017-04-24 14:19:10 -07:00
Martin Braun
c4da30c0ce log: Fixed various issues
- Made the task a regular thread
- Moved verbosity operator into lib
- Minor comments and indents and so on
2017-04-22 19:23:07 -07:00
Martin Braun
33e81c289f log: Added more comments and manual page 2017-04-20 13:38:41 -07:00
Martin Braun
107c105e40 log: Fix missing add_logger, fix clearing of queue 2017-04-20 13:38:20 -07:00
Andrej Rode
372228d2a6 utils: implement Ettus Logging API
- allows adding new loggers by using add_logger API call
 - existing loggers (console, file) can be disabled easily
 - number of logging sinks is not limited

Signed-off-by: Martin Braun <martin.braun@ettus.com>
2017-04-20 11:12:55 -07:00
Andrej Rode
543c8c40f1 utils: add coloring depending on loglevel to console output 2017-04-07 14:54:03 -07:00
Andrej Rode
644ee82123 utils: provide fallback to previous loglevel on reading environment/defines 2017-02-23 14:59:31 -08:00
Andrej Rode
21aad77c9c utils: introduce new logging API and remove msg API 2017-02-20 17:13:15 -08:00
Nicholas Corgan
b634fbcfa1 log: remove MSVC 2010 Boost bug workaround 2016-03-11 09:47:00 -08:00
Martin Braun
c6c2f14d84 uhd: Switched lock_guards header to locks.hpp 2014-09-30 09:35:57 -07:00
michael-west
fa0313652c uhd: Fixed logging bug (#476) -- UHD logging has unexplained effect on packet loss.
- Removed logging from radio_ctrl_core_3000
- Changed logging facility to prevent type conversion when message is not logged
2014-09-24 17:36:04 -07:00
Nicholas Corgan
468e7f35af log: replaced usage of deprecated boost::filesystem function 2014-05-12 07:18:45 -07:00
Josh Blum
8d5dc71d64 uhd: used shared get_tmp_path for logging as well
Moved some of the log.cpp tmp paths smarts into paths as well
2012-05-16 10:59:09 -07:00
Josh Blum
19ecd43340 uhd: tweaks to log and msg implementation
The implementations now contain the string stream in each instance.
This way there is not a global stringstream to lock access to.
This resolves the issue of nested log calls locking condition.
2011-06-01 13:57:25 -07:00
Josh Blum
5b03ad6473 uhd: init log file lock ptr to null 2011-05-13 12:48:36 -07:00
Josh Blum
853d8121af uhd: work on logging and message facility initialization 2011-05-13 12:41:35 -07:00
Jason Abele
a7927ae951 Make log locking work with picky boost 2011-05-05 15:35:03 -07:00
Josh Blum
9734a74366 uhd: various tweaks to log and msg, replaced a few remaining stdio 2011-05-04 20:40:36 -07:00
Josh Blum
09be0518ce uhd: removed more iostream stuff from usrp* implementations 2011-05-04 19:53:01 -07:00
Josh Blum
7f01386f63 uhd: replaced warning post with calls to UHD_MSG(warning)
The message api can support warnings, error, and status messages.
The default handler is to stdio, but the user can change this.
2011-05-04 18:36:10 -07:00
Josh Blum
e71d2833fb uhd: added interprocess file lock to the logger file 2011-05-04 17:01:41 -07:00
Josh Blum
9439906271 uhd: tweaks for logger file entries 2011-05-04 14:34:57 -07:00
Josh Blum
0de4f165e9 usrp: replaced conditional dboard debug prints w/ UHD_LOGV(often) 2011-05-04 14:34:49 -07:00
Josh Blum
8426a72bd6 uhd: moved the logger into the utils subdir 2011-05-04 14:34:42 -07:00
Renamed from host/lib/log.cpp (Browse further)