summaryrefslogtreecommitdiff
path: root/src/common/log.c
AgeCommit message (Collapse)Author
2018-03-03Update tor.1.txt with the currently available log domains.Alexander Færøy
See: https://bugs.torproject.org/25378
2018-01-30Merge branch 'ticket24902_029_05' into ticket24902_033_02David Goulet
2018-01-30dos: Initial code of Denial of Service mitigationDavid Goulet
This commit introduces the src/or/dos.{c|h} files that contains the code for the Denial of Service mitigation subsystem. It currently contains basic functions to initialize and free the subsystem. They are used at this commit. The torrc options and consensus parameters are defined at this commit and getters are implemented. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-12Fix compilation: logfile_is_external() must accept const*Nick Mathewson
2017-12-12Simplify explicit conditional checks into an inlined function.Alexander Færøy
This patch lifts the check for whether a given log file (`logfile_t`) is an "external logfile" (handled by an external logging system such as syslog, android's logging subsystem, or as an external C callback function) into a function on its own. See: https://bugs.torproject.org/24362
2017-12-11Add support for Android's logging subsystem.Alexander Færøy
This patch adds support for Android's logging subsystem in Tor. When debugging Android applications it is useful to be able to collect information about the application running on the platform via the various system services that is available on the platform. This patch allows you to add "Log notice android" to your torrc and have Tor send everything above and including the notice severity to Android's ring buffer which can be inspected using the 'adb logcat' program. See: https://bugs.torproject.org/24362
2017-12-08Convert remaining function (mostly static) to new free styleNick Mathewson
2017-12-08Replace all FREE_AND_NULL* uses to take a type and a free function.Nick Mathewson
This commit was made mechanically by this perl script: \#!/usr/bin/perl -w -i -p next if /^#define FREE_AND_NULL/; s/\bFREE_AND_NULL\((\w+),/FREE_AND_NULL\(${1}_t, ${1}_free_,/; s/\bFREE_AND_NULL_UNMATCHED\(/FREE_AND_NULL\(/;
2017-12-08Switch to a safer FREE_AND_NULL implementationNick Mathewson
This one only evaluates the input once, so it cannot mess up even if there are side effects.
2017-12-08Convert the rest of src/common's headers to use FREE_AND_NULLNick Mathewson
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-03-16Merge branch 'prop140_21643_diff_only_squashed'Nick Mathewson
2017-03-16Consensus diff backend from Daniel Martí GSOC project.Daniel Martí
(This commit was extracted by nickm based on the final outcome of the project, taking only the changes in the files touched by this commit from the consdiff_rebased branch. The directory-system changes are going to get worked on separately.)
2017-03-15Run the copyright update script.Nick Mathewson
2017-03-14Create logfiles in mode 0640Nick Mathewson
Patch from toralf; closes 21729.
2016-12-16Merge branch 'prop271_030_v1_squashed'Nick Mathewson
2016-12-06Accept non-space whitespace characters in log severity syntax.J. Ryan Stinnett
Adds a test_config_parse_log_severity unit test to verify behavior. Fixes #19965.
2016-11-30Add a GUARD log domain, for use with new guards codeNick Mathewson
2016-10-27Automated change to use smartlist_add_strdupovercaffeinated
Use the following coccinelle script to change uses of smartlist_add(sl, tor_strdup(str)) to smartlist_add_strdup(sl, string) (coccinelle script from nickm via bug 20048): @@ expression a; expression b; @@ - smartlist_add + smartlist_add_strdup (a, - tor_strdup( b - ) )
2016-09-06checkSpace.pl now forbids more identifiers.Nick Mathewson
The functions it warns about are: assert, memcmp, strcat, strcpy, sprintf, malloc, free, realloc, strdup, strndup, calloc. Also, fix a few lingering instances of these in the code. Use other conventions to indicate _intended_ use of assert and malloc/realloc/etc.
2016-08-31setup_capture_of_logs: no longer suppress log messagesNick Mathewson
Previously setup_capture_of_logs would prevent log messages from going to the console entirely. That's a problem, since sometimes log messages are bugs! Now setup_capture_of_logs() acts sensibly. If you really do need to keep a message from going to the console entirely, there is setup_full_capture_of_logs(). But only use that if you're prepared to make sure that there are no extraneous messages generated at all.
2016-07-28Fix a huge pile of -Wshadow warnings.Nick Mathewson
These appeared on some of the Jenkins platforms. Apparently some GCCs care when you shadow globals, and some don't.
2016-06-15Mark src/common tor_assert(0)/tor_fragile_assert() unreached for coverageNick Mathewson
I audited this to make sure I was only marking ones that really should be unreachable.
2016-06-11Add -Wmissing-variable-declarations, with attendant fixesNick Mathewson
This is a big-ish patch, but it's very straightforward. Under this clang warning, we're not actually allowed to have a global variable without a previous extern declaration for it. The cases where we violated this rule fall into three roughly equal groups: * Stuff that should have been static. * Stuff that was global but where the extern was local to some other C file. * Stuff that was only global when built for the unit tests, that needed a conditional extern in the headers. The first two were IMO genuine problems; the last is a wart of how we build tests.
2016-02-27Update the copyright year.Nick Mathewson
2016-02-05Avoid calling log functions in logv when SMARTLIST_DEBUG is definedteor (Tim Wilson-Brown)
2016-02-05Check that the log mutex is initialised before trying to lock or unlock itteor (Tim Wilson-Brown)
2016-01-15Whitespace cleanupNick Mathewson
2016-01-13Revert my addition of callback cleaner and instead use existing ↵Ola Bini
functionality for temporary log files
2016-01-13Remove a small memory leak in log callback setupOla Bini
2015-12-15Replace usage of INLINE with inlinecypherpunks
This patch was generated using; sed -i -e "s/\bINLINE\b/inline/" src/*/*.[ch] src/*/*/*.[ch]
2015-10-02Fix check-spaces complaintsNick Mathewson
2015-09-30Document syslog_identity_tag for add_syslog_logPeter Palfrader
2015-09-30Add SyslogIdentityTagPeter Palfrader
When logging to syslog, allow a tag to be added to the syslog identity ("Tor"), i.e. the string prepended to every log message. The tag can be configured by setting SyslogIdentityTag and defaults to none. Setting it to "foo" will cause logs to be tagged as "Tor-foo". Closes: #17194.
2015-07-15Use C99 variadic macros when not on GCC.Nick Mathewson
1) We already require C99. 2) This allows us to support MSVC again (thanks to Gisle Vanem for this part) 3) This change allows us to dump some rotten old compatibility code from log.c
2015-03-24Merge remote-tracking branch 'public/bug15269'Nick Mathewson
2015-03-14Avoid double-parens in log_fn() messages on clang.Nick Mathewson
On clang (and elsewhere?) __PRETTY_FUNCTION__ includes parenthesized argument lists. This is clever, but it makes our old "%s(): " format look funny. This is a fix on 0957ffeb, aka svn:r288. Fixes bug 15269.
2015-03-14Log version when LD_BUG is logged.Nick Mathewson
Closes ticket 15026.
2015-02-06Avoid logging startup messages twiceSebastian Hahn
2015-02-05use ARRAY_LENGTH macro in domain_to_stringNick Mathewson
2015-02-05Add a string representation for LD_SCHED, and a extra sanity check.Yawning Angel
This both fixes the problem, and ensures that forgetting to update domain_list in the future will trigger the bug codepath instead of a NULL pointer deref.
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-12-21Make log bufer 10k, not 9.78k.teor
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-10-23Fix minor typos, two line lengths, and a repeated includeteor
2014-09-10Remember log messages that happen before logs are configuredNick Mathewson
(And replay them once we know our first real logs.) This is an implementation for issue 6938. It solves the problem of early log mesages not getting sent to log files, but not the issue of early log messages not getting sent to controllers.
2014-09-10Refactor the 'deliver a log message' logic to its own function.Nick Mathewson
2014-09-10Turn log loop into a for loop, and "Does this lf want this" into a fnNick Mathewson
2014-09-10Refactor pending_cb_message_t into a type with proper functionsNick Mathewson
Also, rename it.
2014-07-16fix a c99-ismNick Mathewson