summaryrefslogtreecommitdiff
path: root/absl/log
Commit message (Collapse)AuthorAge
* Test that CHECK respects ABSL_MIN_LOG_LEVELGravatar Abseil Team2023-07-14
| | | | | | | | Ensure that the CHECK expression and message are stripped when FATAL is below ABSL_MIN_LOG_LEVEL. PiperOrigin-RevId: 548157637 Change-Id: I4308ff7ff75aabebdd2dcefa2771cd7e77112817
* Use new emscripten_errn to avoid copying strings.Gravatar Abseil Team2023-07-13
| | | | | PiperOrigin-RevId: 547895328 Change-Id: If5da952604415fa6ed2402052f80add6c4b7dfb3
* Rolls back use of emscripten_errn as some implementations may not be compatible.Gravatar Abseil Team2023-06-30
| | | | | PiperOrigin-RevId: 544677169 Change-Id: I98874c5c8d1c9a057958b63e2b3c4fdd5daccd39
* Use new emscripten_errn to avoid copying strings.Gravatar Abseil Team2023-06-29
| | | | | PiperOrigin-RevId: 544461113 Change-Id: Iafbd6daf2d03ae18a49ea449315ee7cd6a0e615e
* Support Qualcomm Hexagon DSP targets.Gravatar Abseil Team2023-06-29
| | | | | PiperOrigin-RevId: 544438364 Change-Id: I22d461f2d0aa8638a0e640eebecdc7e5e2b49ea3
* Remove two_ASCII_digits and replace with a scalar algorithmGravatar Abseil Team2023-06-13
| | | | | PiperOrigin-RevId: 539900072 Change-Id: I675386e3184f6f5ab70b851add970c91d1dde9c5
* For web assembly, implement WriteToStderr as emscripten_err.Gravatar Abseil Team2023-05-30
| | | | | | | This avoids the need to use filesystem APIs just to write to stderr, which emscripten implements the same as this under the hood. PiperOrigin-RevId: 536525710 Change-Id: I0a647a4593eacfba324505b6e8c4acfb577ac839
* Migrate most RAW_LOGs and RAW_CHECKs in tests to regular LOG and CHECK.Gravatar Andy Getzendanner2023-05-23
| | | | | | | | | | | The non-RAW_ versions provide better output but weren't available when most of these tests were written. There are just a couple spots where RAW_ is actually needed, e.g. signal handlers and malloc hooks. Also fix a couple warnings in layout_test.cc newly surfaced because the optimizer understands CHECK_XX differently than INTERNAL_CHECK. PiperOrigin-RevId: 534584435 Change-Id: I8d36fa809ffdaae5a3813064bd602cb8611c1613
* Rename ABSL_*_IMPL macros to match the other ABSL_LOG_INTERNAL_* macros and ↵Gravatar Andy Getzendanner2023-05-19
| | | | | | | | | to make sure it's clear that they're internal. Also rename the log and check test files from .h to .inc per https://google.github.io/styleguide/cppguide.html#Self_contained_Headers. PiperOrigin-RevId: 533603350 Change-Id: Iad5d8b683e33b63784cc8e64b84da09f5fc3bf1e
* Instantiate LogMessage::CopyToEncodedBuffer separately for literals and ↵Gravatar Andy Getzendanner2023-05-01
| | | | | | | | | | | non-literals to save an instruction at each operator<<(string) callsite. The operator<<s get inlined at the callsite. The saved instruction is a 'load immediate' to put the StringType argument in a register for passing. This does make the logging TU slightly larger, but it will be an overall size win for all but the smallest programs. Smaller, faster code at callsites is worth it anyway. PiperOrigin-RevId: 528569773 Change-Id: Id8185266a975a12ab6f1a553c2c0846261822396
* Shrink most LOG callsites by one instruction (SysV x86_64 ABI) by ↵Gravatar Andy Getzendanner2023-04-28
| | | | | | | | | | | dispatching to per-severity constructors and omitting the severity argument. In that particular ABI, the empty tag structs are NO_CLASS and don't appear in the generated code. https://godbolt.org/z/crqaPh8Kv PiperOrigin-RevId: 527989179 Change-Id: I365f11f6ca1de2623690d0a04e6f02f7de82b1fc
* Fix some spelling mistakesGravatar Vertexwahn2023-04-24
|
* Fix handling of `CHECK` macros in static analysis tools.Gravatar Abseil Team2023-04-24
| | | | | | | Currently static analysis tools built using the Clang Dataflow Analysis framework can't prove that code under `switch (0) case 0:` is executed on all paths. The Clang Dataflow Analysis framework should ultimately be improved to handle these cases. In the meantime, to enable the use of such tools in their current state, we add a `default` case back to the `switch` statement in `ABSL_LOG_INTERNAL_STATELESS_CONDITION` to help them understand that the code is executed on all paths. PiperOrigin-RevId: 526638852 Change-Id: I49490dd477ba777aae2530697b75b583242aebc5
* Add configurability of the log Tag value on AndroidGravatar Abseil Team2023-04-18
| | | | | PiperOrigin-RevId: 525178448 Change-Id: I0f35a38f23316b25621148b7fe59becf72bafeff
* Add an API to clear the saved LogBacktraceAt location, and call it when ↵Gravatar Andy Getzendanner2023-04-18
| | | | | | | setting an empty or invalid flag value. PiperOrigin-RevId: 525065479 Change-Id: I3c0822db8301e0999b0669394b415df82edd445f
* Internal cleanupGravatar Abseil Team2023-04-03
| | | | | PiperOrigin-RevId: 521525676 Change-Id: I40083f534c6904b4823138666deac18ffe6deab6
* Add a clang-cl buildGravatar Derek Mauro2023-03-31
| | | | | PiperOrigin-RevId: 520925224 Change-Id: I8b7eb8b4d4b99d72b860aec532516b428fb2be23
* Changes necessary to support clang-clGravatar Derek Mauro2023-03-30
| | | | | | | | This change fixes -Wimplicit-const-int-float-conversion warnings by making the conversions explicit. PiperOrigin-RevId: 520707623 Change-Id: Ib6917469120cd7458257195cbf39beb3fd397543
* Change from `ABSL_DLL ABSL_CONST_INIT` to `ABSL_CONST_INIT ABSL_DLL`Gravatar Derek Mauro2023-03-01
| | | | | | | This avoids "error: an attribute list cannot appear here" PiperOrigin-RevId: 513430681 Change-Id: I0fd31771793ee4cb66149ef4ce3e3e064dfb260d
* Initialize ScopedMockLog.is_triggered_ with false.Gravatar Abseil Team2023-02-23
| | | | | | | | | In C++20, this happens by default, but in C++17, it's left uninitialized if no logs are sent and StartCapturingLogs is never called. The destructor then makes an attempt to access it, which is both unsafe and not very useful while it is uninitialized. Also add a test that expects the appropriate CHECK fail when StartCapturingLogs is not called. PiperOrigin-RevId: 511865440 Change-Id: Ie23ff3f901e926761d5f487e10d33c21c3bd43d3
* Convert empty constructors to default onesGravatar Rose2023-02-17
| | | | These make the changed constructors match closer to the other ones that are default.
* Fix absl/log:stripping_test when ABSL_MIN_LOG_LEVEL is definedGravatar Abseil Team2023-02-13
| | | | | | | | The test was getting tripped by EXPECT_DEATH_IF_SUPPORTED keeping a literal copy of the test statement. PiperOrigin-RevId: 509299343 Change-Id: I63da29d844cc630d750535fd4bb13a2895d32541
* Fix missing constexpr on GetReferenceableValue overloadGravatar Abseil Team2023-02-13
| | | | | PiperOrigin-RevId: 509236105 Change-Id: I635f521aff106875f06bb93c332d3e437d0ad409
* Work around GCC -Wuninitialized when initializing a span from an ↵Gravatar Andy Getzendanner2023-01-24
| | | | | | | | | uninitialized array in logging. It's uninitialized on purpose; we'll write into it through the span. PiperOrigin-RevId: 504318917 Change-Id: I79835f0190253b8b470b3ca404f3979715f2a718
* Include Abseil logging in windows dll, and add a test helper dll.Gravatar Mike Kruskal2023-01-24
| | | | | | | This was tested with https://github.com/protocolbuffers/protobuf/pull/11623 in Protobuf's windows shared library build. PiperOrigin-RevId: 504294227 Change-Id: I9657197e649a334585bffa2c7bc6340cd2354e84
* extern-ify NullGuard's "(null)" strings to save linker input bytes.Gravatar Andy Getzendanner2023-01-17
| | | | | PiperOrigin-RevId: 502689876 Change-Id: If75b00e2e257283b60c41411ef7a60dbd7cd8c6d
* Use NullGuard for signed and unsigned char pointer types, and extend ↵Gravatar Andy Getzendanner2023-01-13
| | | | | | | volatile pointer type testcase to char pointers. PiperOrigin-RevId: 501781539 Change-Id: I99012cecd960745de8a921b96671cde42e28a3af
* Fix some -Wshorten-64-to-32 for 32bit platformGravatar Abseil Team2022-12-22
| | | | | PiperOrigin-RevId: 497124964 Change-Id: Ia5d7005fa9bc422c1ac9a47d5cbaf8c6b8f06d84
* Fix a -Wsign-conversion and some -Wshorten-64-to-32.Gravatar Andy Getzendanner2022-12-19
| | | | | PiperOrigin-RevId: 496397075 Change-Id: Ib44467cf5704b9147c7fd197e8343a666fada1c3
* Use ABSL_LOG instead of LOG in absl::LogStreamer.Gravatar Andy Getzendanner2022-12-17
| | | | | PiperOrigin-RevId: 496112752 Change-Id: I0a7a8854a642f63ddd3ba67b9268bbb0803118e9
* Prevent all CHECK functions from expanding macros for the error string.Gravatar Mike Kruskal2022-12-13
| | | | | | | | | This was likely an unintentional behavior change made a while ago while trying to reduce duplication. The new behavior will always include the unexpanded macro in the error string. For example, `CHECK_EQ(MACRO(x), MACRO(y))` will now output "MACRO(x) == MACRO(y)" if it fails. Before this change, CHECK and QCHECK were the only macros that had this behavior. Not using function-like macro aliases is a possible alternative here, but unfortunately that would flood the macro namespace downstream with CHECK* and break existing code. PiperOrigin-RevId: 495138582 Change-Id: I6a1afd89a6b9334003362e5d3e55da68f86eec98
* Fixing macro expansion changes in new logging macros.Gravatar Mike Kruskal2022-12-08
| | | | | | | | | This was an unintentional behavior change when we added a new layer of macros. Not using function-like macro aliases would get around this, but unfortunately that would flood the macro namespace downstream with CHECK and LOG (and break existing code). Note, the old behavior only applied to CHECK and QCHECK. Other CHECK macros already had multiple layers of function-like macros and were unaffected. PiperOrigin-RevId: 493984662 Change-Id: I9a050dcaf01f2b6935f02cd42e23bc3a4d5fc62a
* Add some missing copts and linkopts in logging and fix the warningsGravatar Derek Mauro2022-12-07
| | | | | PiperOrigin-RevId: 493617276 Change-Id: Ia7fb938c7abfba10e5b62f43f3cf71fb99b132f5
* Create alternate absl-prefixed versions of absl logging macros.Gravatar Mike Kruskal2022-12-06
| | | | | | | This will allow OSS code to use absl logging without necessarily polluting the preprocessor symbols with definitions for LOG and CHECK PiperOrigin-RevId: 493404211 Change-Id: I7bc5807252218dd7fc26da3af13d5734ef8b2601
* Move implementations of absl logging to an internal file.Gravatar Mike Kruskal2022-12-06
| | | | | | | This will allow us to create ABSL_-prefixed variants with shared implementation. PiperOrigin-RevId: 493383908 Change-Id: I3529021df7afa642fadaf43eb9fd8249e9202758
* Write (more) directly into the structured buffer from StringifySink, ↵Gravatar Andy Getzendanner2022-11-28
| | | | | | | including for (size_t, char) overload. PiperOrigin-RevId: 491456410 Change-Id: I76dec24b0bd02204fa38419af9247cee38b1cf50
* Zero encoded_remaining when a string field doesn't fit, so that we don't ↵Gravatar Andy Getzendanner2022-11-21
| | | | | | | leave partial data in the buffer (all decoders should ignore it anyway) and to be sure that we don't try to put any subsequent operands in either (there shouldn't be enough space). PiperOrigin-RevId: 490143656 Change-Id: I4d743dd9214013fbd151478ef662d50affd5ff7a
* Drop outdated comment about LogEntry copyability.Gravatar Andy Getzendanner2022-11-18
| | | | | PiperOrigin-RevId: 489569565 Change-Id: Ia08c0c956a672ad435885c68f3e4a3de0405dad1
* Release structured logging.Gravatar Andy Getzendanner2022-11-17
| | | | | | | This stores the operands to LOG (and CHECK) as separate fields in a serialized protobuf. The protobuf format is not yet published. PiperOrigin-RevId: 489275799 Change-Id: I86d83671a6b1feb2bddd5bee51552907897ca8eb
* Minor formatting changes in preparation for structured logging...Gravatar Andy Getzendanner2022-11-16
| | | | | PiperOrigin-RevId: 489044912 Change-Id: I1657dd60bcfa2d0fb4b889f27f4f237325b73f08
* Refactor "RAW: " prefix formatting into FormatLogPrefix.Gravatar Andy Getzendanner2022-11-16
| | | | | | | This is used when demoting regular logging inside a LogSink::Send to raw-like to avoid infinite recursive dispatch. PiperOrigin-RevId: 488934154 Change-Id: I0aaaeea0ceaaff3c4394308a7102a55befbef290
* Replace std::atomic_flag with std::atomic<bool> to avoid the C++20Gravatar Derek Mauro2022-11-09
| | | | | | | | | | | | | | | | | deprecation of ATOMIC_FLAG_INIT. Another option would have been to use macros to only initialize std::atomic_flag before C++20, but I decided to use one compilation path instead. The major difference between std::atomic_flag and std::atomic<bool> is that the former is guaranteed to be lock-free, but we already assume std::atomic<bool> is lock-free in many places. https://en.cppreference.com/w/cpp/atomic/atomic_flag PiperOrigin-RevId: 487397075 Change-Id: I3f1c539ec8b2ca58547282e69ed73e93243e8efe
* drop an unused depGravatar Andy Getzendanner2022-11-08
| | | | | PiperOrigin-RevId: 486867412 Change-Id: Ib54b1acaf1ea57f8f377c87261d7d52e9a48784f
* Factor out the internal helper AppendTruncated, which is used and redefined ↵Gravatar Andy Getzendanner2022-11-07
| | | | | | | in a couple places, plus several more that have yet to be released. PiperOrigin-RevId: 486759835 Change-Id: Ib1b24f287f856ca38b691fbce7e747f0f5a34626
* Narrow some _MSC_VER checks to not catch clang-cl.Gravatar Andy Getzendanner2022-11-04
| | | | | PiperOrigin-RevId: 486227733 Change-Id: If492d715e5758971cf7bd0ccd748b47b1424a3c7
* Small cleanups in logging test helpersGravatar Andy Getzendanner2022-11-03
| | | | | PiperOrigin-RevId: 486023797 Change-Id: I0b82754fd40c2d6fb451f304aaf1d795eed8d009
* Support logging of user-defined types that implement `AbslStringify()`Gravatar Phoebe Liang2022-11-02
| | | | | | | | | If a user-defined type has `AbslStringify()` defined, it will always be used for logging over `operator<<`. `HasAbslStringify` now uses the empty class `UnimplementedSink` for its checks instead of `StringifySink` in order to make it work in cases involving other sinks. PiperOrigin-RevId: 485710377 Change-Id: Ibdd916151c7abc3269c35fbe79b772867f3d25e1
* Fix a truncation warning on Windows 64-bit.Gravatar Abseil Team2022-10-18
| | | | | | Bug: chromium:1292951 PiperOrigin-RevId: 482021281 Change-Id: I01c25dcb2dae82fcee25da00aefec4484f7c409d
* Fix various warnings for _WIN32.Gravatar Abseil Team2022-10-17
| | | | | | Bug: chromium:1292951 PiperOrigin-RevId: 481757795 Change-Id: I03c808222c6c4d3d7052576ab4b36141e5f1ebbc
* Disables StderrKnobsDefault due to order dependencyGravatar Abseil Team2022-10-17
| | | | | | | The SetLogtostderr and SetAlsologtostderr tests are setting flags that cause the stderrthreshold global value to be out of sync with the stderrthreshold flag. As a result, it is not currently possible to remove order dependency with these existing tests. PiperOrigin-RevId: 481731395 Change-Id: Ie992520982f2e69821d1d1b660e3326bf745ef0d