summaryrefslogtreecommitdiff
path: root/src/common/log.c
AgeCommit message (Collapse)Author
2018-06-22Extract the locking and logging codeNick Mathewson
The locking code gets its own module, since it's more fundamental than the higher-level locking code. Extracting the logging code was the whole point here. :)
2018-06-22Remove compat.h as unneeded from log.c and torlog.hNick Mathewson
2018-06-22Extract our code for answering "what time is it right now".Nick Mathewson
The other time stuff is higher-level
2018-06-22Extract smartlist.h from container.hNick Mathewson
2018-06-22Rectify include paths after container split (automatic)Nick Mathewson
2018-06-21Rectify include paths (automated)Nick Mathewson
2018-06-20Move horrible-emergency handling into torerr.[ch]Nick Mathewson
Previously we had code like this for bad things happening from signal handlers, but it makes sense to use the same logic to handle cases when something is happening at a level too low for log.c to be involved. My raw_assert*() stuff now uses this code.
2018-06-20Remove all use of the assert.h headerNick Mathewson
Nothing in Tor has actually called assert() for some while.
2018-06-20Add raw_assert() variants for cases where we cannot log.Nick Mathewson
Remove a different raw_assert() macro declared in log.c
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-05-01Add a mechanism for the logging system to report queued callbacksNick Mathewson
Sometimes the logging system will queue a log message for later. When it does this, the callback will either get flushed at the next safe time, or from the second-elapsed callback. But we're trying to eliminate the second-elapsed callback, so let's make a way for the log system to tell its users about this.
2018-03-19Merge remote-tracking branch 'isis/bug23881_r1'Nick Mathewson
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>
2018-01-22fixups from code reviewChelsea Holland Komlo
2017-12-21add minimal rust module for logging to tor's loggerChelsea Holland Komlo
Allows an optional no-op for testing purposes
2017-12-21Add minimal implementations of functions Rust needs for loggingNick Mathewson
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.