This course will be retired on June 1, 2025.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
As we've been going along coding programs so far, when we need to know the value of a variable or debug some piece of data, we've generally been using print or puts statements of some sort. This works just fine for smaller programs. However, as you start to write larger programs, it can be cumbersome and sometimes ineffective to stop the program and print things to the screen. In cases like this, we can use something called log to write data to a stream. The stream can be a file, standard output, the network, and more. We can write things like the current state of our classes and objects, errors, and more. The Ruby standard library comes with logging functionality in the form of the Logger class from the Standard Library
Links
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up