Using events
We saw how to use events in Chapter 8, Exceptions, Events, and Logging. Information from events can be automatically read by observing the events and this information can provide data about current transactions, the functions involved, function parameters, current values in state variables, and so on. This information is available from events in real time and assists debugging, not only during development but also in production environments. Contracts should declare events, and functions should invoke these events at appropriate locations with information that provides enough context to whoever is reading these events.