August 2018
Intermediate to advanced
380 pages
10h 2m
English
In an example in the Referential Transparency section of this chapter, we saw how logging can also be a side effect. Logging can be done using a separate login framework, or it can be as simple as writing to the standard output.
Things may get tricky with logging when you work in an unfamiliar environment. For example, if it is the environment of your desktop computer, everything is simple. You run a program from your terminal, and it outputs everything to the terminal. However, what if it is a web server? Often, you need to output your log into a separate file for it to be readable afterward. Alternatively, what if you are writing a mobile application? The program runs on a separate device, and it is not always the case that a print ...