码志

Remember a good cache design idea

Original link: https://mazhuang.org/2023/08/27/cache-design/ When discussing interface performance issues with colleagues before, I heard him introduce a cache design idea. I think it is good, and I will make a record for future reference. Scenes Suppose you have an interface of the form: GET /api?keys={key1,key2,key3,…}&types={1,2,3,…} Among them, keys is a list of business primary keys, and

Remember a good cache design idea Read More »

Solve the problem of Java printing log swallowing exception stack

Original link: https://mazhuang.org/2023/06/26/java-swallow-stacktrace/ A few days ago, a classmate asked me to check a null pointer problem. When Java printed the log, the exception stack information was swallowed, which made it impossible to locate the problem. Phenomenon The code for catching exceptions and printing logs looks like this: try { // … } catch (

Solve the problem of Java printing log swallowing exception stack Read More »

Can the log that is automatically completed by AI be printed normally?

Original link: https://mazhuang.org/2023/05/10/can-this-log-print-work/ I have recently used GitHub Copilot, and its capabilities have amazed me from time to time, so more and more tab-oriented programming, the loss of mechanical keyboards is much smaller:-p Today, it automatically generated a log printing code like this for me: try { // … } catch ( Exception e )

Can the log that is automatically completed by AI be printed normally? Read More »