You are currently not logged in and your progress will not be saved. Register or Log in

Lesson 4 – Printing messages to console and logging

Overview

One of the very first things to learn in a new software development environment is the ability to print messages like the popular “Hello World!” on a console. In the previous lesson, we have briefly seen printk() to print simple messages on the console. In this lesson we will learn more about logging using both the simple method of printk() and a sophisticated method using the advanced logging module.

In the exercises section of this lesson, we will first practice using the user-friendly printk() function to print string literals and formatted strings to a console. In Exercise 2, we will cover enabling/configuring the features-rich logger module to print string literals, formatted strings, and hex dump variables. Lastly, in Exercise 3, we will examine the logger module features in more depth.

Objectives

  • Learn how to print strings and formatted strings to a console using printk()
  • Recognize the limitations of  printk()
  • Learn how to print strings and formatted strings to a console using the logger module
  • Learn how to hex dump variables using the logger module
  • Explore the logger module features
  • Practice through hands-on exercises enabling/configuring software modules