November 2017
Intermediate to advanced
386 pages
9h 22m
English
The second idea we mentioned is based on the addLogging() function that we wrote in the Logging section of Chapter 6, Producing Functions - Higher-Order Functions. The idea was to wrap a function with some logging functionality so that on entry, the arguments would be printed and on exit, the result of the function would be shown:
pipeline2( addLogging(getDir), addLogging(filterOdt), addLogging(count))("/home/fkereki/Documents"));entering getDir: /home/fkereki/Documentsexiting getDir: ...the list of all the files in the directory...entering filterOdt: ...the same list of files...exiting filterOdt: ...the list of files with names ending in odt...entering count: ...the list of files with names ending in odt...exiting ...
Read now
Unlock full access