Smart Contract Dev Interview Prep: Logging & Monitoring?
hey, I bombed an interview question n dont know how to answer.
"You're building a Solidity smart contract on a Layer 2 chain. Your basic event logging isn’t giving enough detail for debugging (e.g., missing variable states or conditional checks), but adding more events risks spiking gas fees. How would you improve logging depth without hurting Layer 2’s cost efficiency?"
I froze n dont know how to explain cheaper data types in event and interview was pushing the alternatives n i was blank. now before next interview i need help with few doubts.
are there something like lazy logging meaning logging only critical data n inferring the rest off chain?
interview mentioned about Graph. are there some custom subgraphs to handle these issues or it is better to stack for granular L2 data
which hacks L2 uses to making the logging better price than L1
Thanks for helping me turn this L into a learning moment