From the course: Rust Programming: Beginner to Advanced
Unlock this course with a free trial
Join today to access over 26,200 courses taught by industry experts.
Using println! and logging - Rust Tutorial
From the course: Rust Programming: Beginner to Advanced
Using println! and logging
We're continuing a series on debugging in Rust with a focus on two essential techniques, using println and logging. These tools are the bread and butter of debugging for both beginners and experienced developers. Whether you're just getting started or looking to deepen your understanding, this video will walk you through how to effectively use println for quick debugging, and how to set up more sophisticated logging in your Rust applications. Let's start with the basics using println. We know println is a macro in Rust that prints text to the console. It's incredibly useful for quick and dirty debugging because it allows you to output the value of variables or track the flow of your program. Let's look at a simple println example. Over here, we have a println statement printing the value of x and y. These lines output the value of x and y variables to the console. And it's a quick way to see what's happening inside your program and what are the values of variables. So, what can be the…
Download courses and learn on the go
Watch courses on your mobile device without an internet connection. Download courses using your iOS or Android LinkedIn Learning app.
Contents
-
-
(Locked)
Writing and running your first Rust program3m 38s
-
(Locked)
Comments2m 39s
-
(Locked)
Variables and mutability1m 53s
-
(Locked)
Scalar and compound data types6m 5s
-
(Locked)
Constants2m 33s
-
(Locked)
Shadows3m 11s
-
(Locked)
Macros2m 28s
-
(Locked)
Control flow: if, else-if, else4m 34s
-
(Locked)
Control flow: loop and labels4m 43s
-
(Locked)
Control flow: for and while4m 46s
-
(Locked)
Control flow: Pattern matching with `match`4m 12s
-
(Locked)
-
-
(Locked)
Introduction3m 47s
-
(Locked)
Stack and heap4m 19s
-
(Locked)
The string type and ownership2m 39s
-
(Locked)
Scope and ownership1m 54s
-
(Locked)
Variables and data interacting with move7m 29s
-
(Locked)
Variables and data interacting with clone2m 44s
-
(Locked)
Ownership and functions5m 11s
-
(Locked)
References and borrowing3m 19s
-
(Locked)
Immutable and mutable references4m 15s
-
(Locked)
Rules of references7m 46s
-
(Locked)
The slice type3m 3s
-
(Locked)
Rules for slices2m 32s
-
(Locked)
-
-
(Locked)
Structs16m 8s
-
(Locked)
Methods8m 3s
-
(Locked)
Enums18m 26s
-
(Locked)
Vectors5m 43s
-
(Locked)
Hashmaps13m 40s
-
(Locked)
Unrecoverable errors5m 40s
-
(Locked)
Recoverable errors8m 29s
-
(Locked)
Creating custom error types13m 29s
-
(Locked)
Logging libraries10m 2s
-
(Locked)
Logging - Best practices2m 26s
-
(Locked)
-
-
(Locked)
Introduction to smart pointers4m 49s
-
(Locked)
Box<T>: Single ownership and heap allocation7m 27s
-
(Locked)
Rc<T>: Reference counting and shared ownership7m 2s
-
(Locked)
RefCell<T> and interior mutability14m 6s
-
(Locked)
Weak<T>: Breaking reference cycles10m 22s
-
(Locked)
Implementing your own smart pointer9m 52s
-
(Locked)
-
-
(Locked)
Introduction to network programming in Rust8m 53s
-
(Locked)
Building TCP clients and servers10m 42s
-
(Locked)
Building UDP clients and servers8m 57s
-
(Locked)
Introduction to file handling in Rust10m 39s
-
(Locked)
Performing common filesystem operations5m 55s
-
(Locked)
Project: Networked file transfer application (key concepts: TCP communication, file reading/writing, error handling)20m 33s
-
(Locked)
-
-
(Locked)
Introduction to WebAssembly and why Rust?7m 4s
-
(Locked)
Setting up your Rust and WebAssembly development environment8m 52s
-
(Locked)
Interacting with WebAssembly from JavaScript6m 29s
-
(Locked)
Accessing WebAssembly memory from JavaScript8m 40s
-
(Locked)
Building a mini project: Log analyzer13m 22s
-
(Locked)