summaryrefslogtreecommitdiff
path: root/lib/common/Logging.h
Commit message (Collapse)AuthorAge
* Reduce precision of common timer testChris Wilson2017-06-22
| | | | | | | | | | | | | | | | | | Ideally timers would be perfectly accurate and we could sleep for 1.0 seconds, but on OSX in particular they could fire 50-100 ms late (I've seen 4 ms in practice) and we don't want the tests to fail because of this, because we don't really need that kind of precision in practice. So we reduce the timer intervals by 100ms to be safe. Increase logging level and add timestamps in testcommon. Should help to debug frequent test failures such as Condition [t2.HasExpired()] on OSX hosts on Travis. Add a SettingsGuard to the Console logger for its specific settings, such as showing times and microseconds. (cherry picked from commit a5e6cff1d435329b0121417ed9509e315ce0edd5) (cherry picked from commit 8d02eebce553ed822e0fcd60d6e319384e15ba4b)
* Remove duplicate error number from Windows log messages.Chris Wilson2015-12-24
| | | | | GetErrorMessage() already includes the error number in the text string that it returns, so we don't need to include it again.
* Add command-line option to limit log messages to certain file(s).Chris Wilson2015-05-04
| | | | | E.g. you can run with -L NamedLock.cpp to only show messages logged in that file. You can also repeat it to only show messages from certain files.
* Define BOX_SOCKET_ERROR_MESSAGE, replace more BOX_LOG_SOCKET_ERROR calls ↵Chris Wilson2015-04-15
| | | | with it.
* Improve error logging in win32 emu library.Chris Wilson2015-04-06
| | | | | | Consistently capture the last Windows error code in the global variable winerrno. Add logging macros that report the Windows error message for this error code.
* Fix BOX_SYSLOG macro to provide a category.Chris Wilson2015-02-25
|
* Reduce test output noise by hiding some error messages in tests.Chris Wilson2015-02-25
| | | | | Should make the Travis logs shorter and more readable.
* Reduce detail on logging box_time_ts from microseconds to milliseconds.Chris Wilson2014-12-21
| | | | | | There's not much point logging with higher precision when no normal platform will deliver it.
* Add option to truncate log file at start of every backup.Chris Wilson2014-11-16
| | | | Prevents backup log files from becoming too large.
* Fix formatting of subsecond timestamps in log messagesChris Wilson2014-09-18
|
* Refactor logging option processing out of Daemon class.Chris Wilson2014-04-09
| | | | Allows command-line tools to reuse the same option processing.
* Add a capturing logger.Chris Wilson2014-04-09
| | | | Useful in testing whether code logs the expected messages or not.
* Add a guard that can temporarily add a Logger to the logging system.Chris Wilson2014-04-09
| | | | This is very useful with the forthcoming Capture logger.
* Remove the global logging level.Chris Wilson2014-04-09
| | | | | It's incompatible with having a logger that logs everything, regardless of the global log level.
* Allow a logging tagger to temporarily replace the current tag.Chris Wilson2014-02-08
| | | | | | Sometimes useful to replace instead of appending to the current tag. The old tag will be reinstated when the tagger is destroyed.
* Add a logging guard that temporarily enables tagging on the console.Chris Wilson2014-02-08
| | | | | This is useful for disambiguating messages coming from different parts of the application when looking at console output.
* Allow checking whether console logging is currently tagged.Chris Wilson2014-02-08
|
* Close syslog before checking for files left open in tests.Chris Wilson2014-02-07
| | | | Otherwise we might detect the opened syslog socket as a leaked file descriptor.
* Allow getting the standard Console and Syslog loggers. Add a Guard classChris Wilson2012-11-27
| | | | | that can be used to protect against permanent changes to their log levels.
* Fix duplicate tagging of housekeeping messages.Chris Wilson2012-11-17
|
* BOX_FORMAT_MICROSECONDS doesn't make sense unless the digits to the rightChris Wilson2012-11-07
| | | | | of the decimal point are padded properly.
* Convert FORMAT_MICROSECONDS into a global utility macro.Chris Wilson2012-11-06
|
* Allow hiding specific exceptions to keep test output cleaner.Chris Wilson2012-04-28
|
* Allow overriding Logging::Guard to dump stack backtraces as well.Chris Wilson2012-01-23
|
* Remove unnecessary GetNativeErrorMessage(), add BOX_LOG_SOCKET_ERROR macro.Chris Wilson2012-01-22
|
* Add some macros for Windows specific error logging.Chris Wilson2011-03-27
|
* Add some more logging and exception macros. Refactor to reduce nestingChris Wilson2011-01-12
| | | | | depth and increase modularity.
* Add a macro for logging timespec structures. (merges [2744])Chris Wilson2011-01-08
|
* Add a new exception macro for throwing exceptions that are related to a Chris Wilson2010-03-18
| | | | | file but not system errors.
* Rename LOG_AND_THROW_ERROR macro to THROW_SYS_ERROR for consistency and Chris Wilson2010-02-22
| | | | | brevity. Add THROW_SYS_FILE_ERROR which adds a filename to the message.
* Log more detailed info about backup comparison failures, for debugging.Chris Wilson2010-02-10
| | | | | | Enable -V option in bbackupquery, and document that -q, -v, -V and -W<level> are allowed in the command-line help.
* Suppress exception warnings when they are expected during a test.Chris Wilson2009-07-05
|
* Add ability to specify a named log facility for syslog loggins, Chris Wilson2009-03-24
| | | | | requested by Kenny Millington.
* Add a function to return a native error message as a string.Chris Wilson2008-12-30
|
* Add BOX_LOG_NATIVE_ERROR and BOX_LOG_NATIVE_WARNING macros, which callChris Wilson2008-12-05
| | | | | | | | | BOX_LOG_SYS_* or BOX_LOG_WIN_* depending on platform, as this is a common reason for #ifdefs elsewhere in the code. Add BOX_LOG_SOCKET_ERROR macro to log socket errors with the type, name and port of the socket that suffered the error.
* Compile fix and log the error number recorded by winerrno, notChris Wilson2008-11-30
| | | | | the "last" error, whatever that was.
* Add file logger class.Chris Wilson2008-09-26
|
* Unify program name and console logging tags.Chris Wilson2008-09-13
| | | | | | Add a new class, Logging::Tagger, which can be used to temporarily add information to the program name, such as the client ID in bbstored.
* Remove Windows limitation on Logging that showing PID was not possible.Chris Wilson2008-08-03
|
* Remove comma from last item in enum, to silence warnings from solaris cc.Chris Wilson2008-07-06
|
* Fix strerror include. Needed for gcc 4.3Martin Ebourne2008-05-29
|
* Add static Logging::GetNamedLevel() method to return a log level Chris Wilson2008-05-28
| | | | | specified by name as a string.
* Undo mangling by tailorChris Wilson2008-04-04
|
* TailorizationChris Wilson2008-04-04
| | | | | | | | | | | Import of the upstream sources from Repository: http://localhost:8000/ Kind: hg Revision: 7807b7768163f1c2537756abe5416063989cebb1 Original author: tailor@rocio.int.aidworld.org Date: 2008-03-16 19:44:36+00:00
* Fix a bug where trying to log a variable called "line" would log the addressChris Wilson2008-03-30
| | | | | of the std::ostringstream instead (duh, I hate macros).
* Replace all remaining use of TRACEx() macros with logging framework.Chris Wilson2008-03-29
| | | | | Remove the old TRACEx macros to catch any remaining uses.
* Improve logging with macros that consistently output strerror(errno) andChris Wilson2008-03-28
| | | | | | | | | | | | | | | errno, replacing almost all use of strerror() in the main code. Log a more detailed error message before throwing an exception for some more system call failures. Make FileStream store its filename on all platforms, not just Windows. Wrap some long lines at less than 80 characters to improve readability. Fix some minor violations of coding standard (white space) and a typo in a comment.
* Add support for logging just to syslog (not console) at a given Chris Wilson2008-03-01
| | | | | priority.
* Disable -P option and showing PID in Logging on Windows.Chris Wilson2008-02-22
|
* Add support for microsecond timestamps and PID logging on console logChris Wilson2008-01-31
| | | | | for daemons.