Having some kind of debugging tool in our belt is extremely useful before writing a lot of code. In this lesson we build a println!()-style syntax using JavaScript’s console.log to be able to log out values in Rust.
Instructor: [00:00] Before we write much more code, we will want to have some debugging tools in our belt. One simple but still effective tool for investigating our programs is logging.
[00:10] In JavaScript, the console log function is the way to log messages to the browser's developer tool console. Using Rust [inaudible] , we can import a reference to it. Using the Rust macro, we can provide a [inaudible] style syntax for console log, logging from Rust.
[00:33] In our run function, we now can use the log macro and log the side value to the console. We reload the page in our browser and can see the meaning of life is 42. Great, our macro worked.
@Jack the "C" is not mandatory as far as I know or what do you mean?
The extern "C" code block isn't in my ./crate/src/lib.rs file?