Mix Assertion, Logging, Unit Testing and Fuzzing with ZeroErr
Mix Assertion, Logging, Unit Testing and Fuzzing with ZeroErr Build Safer Modern C++ Application Speaker: Xiaofan Sun Date: Sep 19, 2024Self-Introduction • Got my Ph.D. from UC, Riverside Pointer: std::unique_ptrClass from third-party library: llvm::Value*Logging the Data // LOG(INFO) << Data; // ASSERT(a > b, “A > B is not true”, a, b); std::ostream& oper std::unique_ptr ptr); std::ostream& operator<<(std::ostream& out, llvm::Value* data); ......Logging the Data • Namespace pollution • Hard to implement with template • No extensibility • No customization 0 码力 | 54 页 | 961.46 KB | 5 月前3Tornado 6.5 Documentation
Automatically detect code changes in development tornado.concurrent — Work with Future objects tornado.log — Logging support tornado.options — Command-line parsing tornado.testing — Unit testing support for asynchronous org/3/library/constants.html#None] Called after the end of a request.Override this method to perform cleanup, logging, etc. This method is primarily intended as a counterpart to prepare. However, there are a few error html#None]) → None [https://docs.python.org/3/library/constants.html#None] Override to customize logging of uncaught exceptions. By default logs instances of HTTPError as warnings without stack traces0 码力 | 437 页 | 405.14 KB | 2 月前3Tornado 6.5 Documentation
on_finish() → None Called after the end of a request. Override this method to perform cleanup, logging, etc. This method is primarily intended as a counterpart to prepare. However, there are a few error Type[BaseException] | None, value: BaseException | None, tb: TracebackType | None) → None Override to customize logging of uncaught exceptions. By default logs instances of HTTPError as warnings without stack traces result (with one argument, the RequestHandler object). The default implementation writes to the logging module’s root logger. May also be customized by overriding Application.log_request. • serve_traceback:0 码力 | 272 页 | 1.12 MB | 2 月前3Exceptionally Bad: The Story on the Misuse of Exceptions and How to Do Better
in handler and rethrow Logging reported deep in stack instead of at handler site 2. Repackage the Exception as a different type with additional information and rethrow Logging reported at handler site site This can often lead to thinking modes where the logging and the exception/error type are conflated Pattern : Logging/repackaging the exception in the handler with extra information and then rethrow rethrow for error handling elsewhere 42 Bloomberg Exceptional Logging43 Bloomberg Exceptional Logging enum class component_type { text, graphic, heading}; int apply(int key, component_type type) { try0 码力 | 85 页 | 2.32 MB | 5 月前3COMPOSABLE C++
to achieve prioritization. handled unhandled request A B C t f f f t tCASE STUDY: LOGGING CASE STUDY: LOGGING From "Easy to Use, Hard to Misuse: Declarative Style in C++" (CppCon 2018) From "Easy };CASE STUDY: LOGGING CASE STUDY: LOGGING Given the Given the push push function, we can write various function, we can write various log_sink log_sink classes: classes:CASE STUDY: LOGGING CASE STUDY: STUDY: LOGGING Given the Given the push push function, we can write various function, we can write various log_sink log_sink classes: classes: "ordinary" sinks that send entries to di�erent places (�le0 码力 | 124 页 | 8.28 MB | 5 月前3julia 1.10.10
LAPACK functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1345 78 Logging 1361 78.1 Log event structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . around it we can mitigate that here. You may choose how you wish to handle this exception, whether logging it, return a placeholder value or as in the case below where we just printed out a statement. One invocation. This allows macros to include better error diagnostic information, and is commonly used by logging, string-parser macros, and docs, for example, as well as to implement the @__LINE__, @__FILE__,0 码力 | 1692 页 | 6.34 MB | 3 月前3Julia 1.11.6 Release Notes
LAPACK functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1573 80 Logging 1593 80.1 Log event structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . around it we can mitigate that here. You may choose how you wish to handle this exception, whether logging it, return a placeholder value or as in the case below where we just printed out a statement. One invocation. This allows macros to include better error diagnostic information, and is commonly used by logging, string-parser macros, and docs, for example, as well as to implement the @__LINE__, @__FILE__,0 码力 | 2007 页 | 6.73 MB | 3 月前3Julia 1.10.9
LAPACK functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1345 78 Logging 1361 78.1 Log event structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . around it we can mitigate that here. You may choose how you wish to handle this exception, whether logging it, return a placeholder value or as in the case below where we just printed out a statement. One invocation. This allows macros to include better error diagnostic information, and is commonly used by logging, string-parser macros, and docs, for example, as well as to implement the @__LINE__, @__FILE__,0 码力 | 1692 页 | 6.34 MB | 3 月前3Julia 1.11.4
LAPACK functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1573 80 Logging 1593 80.1 Log event structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . around it we can mitigate that here. You may choose how you wish to handle this exception, whether logging it, return a placeholder value or as in the case below where we just printed out a statement. One invocation. This allows macros to include better error diagnostic information, and is commonly used by logging, string-parser macros, and docs, for example, as well as to implement the @__LINE__, @__FILE__,0 码力 | 2007 页 | 6.73 MB | 3 月前3Julia 1.11.5 Documentation
LAPACK functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1573 80 Logging 1593 80.1 Log event structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . around it we can mitigate that here. You may choose how you wish to handle this exception, whether logging it, return a placeholder value or as in the case below where we just printed out a statement. One invocation. This allows macros to include better error diagnostic information, and is commonly used by logging, string-parser macros, and docs, for example, as well as to implement the @__LINE__, @__FILE__,0 码力 | 2007 页 | 6.73 MB | 3 月前3
共 55 条
- 1
- 2
- 3
- 4
- 5
- 6