Skip to content

Latest commit

 

History

History
28 lines (17 loc) · 1.24 KB

README.md

File metadata and controls

28 lines (17 loc) · 1.24 KB

Logging - Standard Library

Logging is an important part of every program. Logs are our eyes and history to what is happening inside the program as it runs. The standard library provides the log package to support the basic features of logging and the ability for you to extend and customize logging to fit your needs.

Notes

  • Support for logging is already built into the standard library.
  • The log package can be easily extended to meet your logging needs.

Links

http://www.goinggo.net/2013/11/using-log-package-in-go.html

Code Review

Use of log package (Go Playground)
Customizing your own log (Go Playground)

Exercises

Exercise 1

Setup a new program to use the log package. Set the Prefix to your first name and on each log line show the date and long path for the code file.

Template (Go Playground) | Answer (Go Playground)


All material is licensed under the Apache License Version 2.0, January 2004.