aboutsummaryrefslogtreecommitdiff
path: root/src/lib/log/log.c
AgeCommit message (Collapse)Author
2024-04-13also consider LD_BUG logs when counting bug reachedtrinity-1686a
2023-09-12add metrics counter for BUG() reachedtrinity-1686a
2021-03-12Update copyrights to 2021, using "make update-copyright"Nick Mathewson
2020-11-12Fix typos.Samanta Navarro
Typos found with codespell. Please keep in mind that this should have impact on actual code and must be carefully evaluated: src/core/or/lttng_circuit.inc - ctf_enum_value("CONTROLER", CIRCUIT_PURPOSE_CONTROLLER) + ctf_enum_value("CONTROLLER", CIRCUIT_PURPOSE_CONTROLLER)
2020-09-23Remove support for old android "logcat" APINick Mathewson
This is apparently obsolete; syslog is modern instead. If users have an android log configured, given them a syslog if we can. Closes #32181.
2020-07-14doc: Move manpages into doc/man/David Goulet
Closes #40044 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-03-09Merge branch 'tor-github/pr/1723'David Goulet
2020-02-13Run "make autostyle"teor
But only take the changes that were caused by the rest of the 33087 branch. Part of 33087.
2020-02-13log: Stop duplicating error file fdsteor
Since we're not closing these fds, they don't need to be duplicated any more. Cleanup after 33087.
2020-02-13err/log: Stop closing stderr and stdout during shutdownteor
Closing these file descriptors can hide sanitiser logs. Instead, flush the logs before tor exits, using fsync(). Some Windows environments don't have fsync(), so we check for it at compile time. Fixes bug 33087; bugfix on 0.4.1.6.
2020-02-06Fix a couple more long warning linesNick Mathewson
These are not a problem with 2-space indentation, but cocci will start getting confused when clang-format wraps them with 4-space indentation.
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-10-22Merge branch 'ticket31705_v2' into ticket31705_v2_mergedNick Mathewson
Conflicts: src/feature/dirparse/authcert_parse.c src/feature/dirparse/ns_parse.c src/feature/hs/hs_service.c src/lib/conf/conftesting.h src/lib/log/log.h src/lib/thread/threads.h src/test/test_options.c These conflicts were mostly related to autostyle improvements, with one or two due to doxygen fixes.
2019-10-22Use #warning instead of #warn: one is C and one isn't.Nick Mathewson
2019-10-22Make a pair of add_*_log() functions mockable.Nick Mathewson
2019-10-17Replace add_temp_log() with add_default_log().Nick Mathewson
We used to have this function so that we could mark our initial log-to-stdout as specifically temporary so that we would delete it once regular logs were configured. But it's no longer necessary to mark these logs as temporary, since we now use a mark-and-sweep process to ensure that _all_ not-configured logs are closed when we change our configuration. Instead, this function will be the basis of a refactoring in how we handle default logs.
2019-10-03Merge branch 'tor-github/pr/1377'George Kadianakis
2019-10-02log: fix a typo in the function comment for log_fn_()teor
Closes 31923.
2019-09-30Re-run "make autostyle" with improved annotate_ifdef_directivesNick Mathewson
2019-09-30log: When initialising log domain masks, only set known log domainsteor
And add a runtime test that checks for unknown domains and flags. Fixes bug 31854; bugfix on 0.2.1.1-alpha.
2019-09-30log: Define count, boundary, and all macros for domains and flagsteor
And do static checks on those macro definitions. Part of 31854.
2019-09-30log: Remove duplicate code and an outdated commentteor
Preparation for 31854.
2019-09-30Merge branch 'tor-github/pr/1302'George Kadianakis
2019-09-30Merge branch 'tor-github/pr/1356'George Kadianakis
2019-09-26log: explain why it is safe to leave the log mutex initializedteor
The log mutex is dynamically initialized, guarded by log_mutex_initialized. We don't want to destroy it, because after it is destroyed, we won't see any more logs. If tor is re-initialized, log_mutex_initialized will still be 1. So we won't trigger any undefined behaviour by trying to re-initialize the log mutex. Part of 31736, but committed in this branch to avoid merge conflicts.
2019-09-25log: Move SEVERITY_MASK_IDX() to log.hteor
Move SEVERITY_MASK_IDX() to log.h private/unit tests section, so that we can use it in log.c, the unit tests, and the fuzzers. (The test and fuzzer code changes are in a subsequent commit.) Preparation for bug 31334.
2019-09-24log: Improve the documentation for tor_log_update_sigsafe_err_fds()teor
Part of 31839.
2019-09-12Merge branch 'tor-github/pr/1303'George Kadianakis
2019-09-09log: Close log and err file descriptors before abortingteor
Part of 31594.
2019-09-09log: Don't close file log fds that are being used by the err moduleteor
Instead, dup() file log fds, before passing them to the err module. Closes 31613, part of 31594.
2019-08-19Fix 64-bit return issue in parse_log_domain()Nick Mathewson
If unsigned int is 32-bits long, then our old code would give a wrong result with any log domain whose mask was >= (1<<32). Fortunately, there are no such log domains right now: the domain mask is only 64 bits long to accommodate some flags. Found by coverity as CID 1452041. Fixes bug 31451; bugfix on 0.4.1.4-rc.
2019-07-24Fix clang-detected errors related to log_domain_mask_tNick Mathewson
2019-07-08Add a compile-time assertion to prevent a recurrence of 31080.Nick Mathewson
2019-06-05Run "make autostyle."Nick Mathewson
2019-03-26Merge branch 'messaging_v3' into messaging_v3_mergedNick Mathewson
2019-03-25Add MESG as a new log domain.Nick Mathewson
2019-01-16Bump copyright date to 2019Nick Mathewson
2019-01-16Bump copyright date to 2019.Nick Mathewson
2018-12-20Add LD_BTRACK log domain for bootstrap trackerTaylor Yu
Part of ticket 27167.
2018-12-17Add "PT" log domain.Alexander Færøy
See: https://bugs.torproject.org/28179
2018-11-27Add LD_PROCESS as log domain.Alexander Færøy
See: https://bugs.torproject.org/28179
2018-11-05Turn the logging code into a subsystemNick Mathewson
2018-11-05Move the code that knows our tor version into a lowest-level libNick Mathewson
2018-08-28Fix log.c comments about assert vs tor_assert vs raw_assert.Nick Mathewson
2018-07-11Move all use cases of micro-revision.i to a single placeNick Mathewson
That place is git-revision.c; git-revision.c now lives in lib/log. Also fix the compilation rules so that all object files that need micro-revision.i depend on it.
2018-07-10Rename tm_cvt to time_to_tmNick Mathewson
2018-07-10Rename torlog.[ch] to log.[ch]Nick Mathewson
Fun fact: these files used to be called log.[ch] until we ran into conflicts with systems having a log.h file. But now that we always include "lib/log/log.h", we should be fine.