From 25c9392948c83c5dd70d829bd9f8a0088e1b7b6c Mon Sep 17 00:00:00 2001 From: Blain Smith Date: Thu, 12 May 2022 11:15:55 -0400 Subject: [PATCH] fix readme example --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5a442e6..0c02d90 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,16 @@ use logfmt; use log; export fn main() void = { + // create an instance of the logger let l = logfmt::new(os::stderr); - log::setlogger(&l); + // set the global logger to the logfmt logger + log::setlogger(&l); - log::println(&l, "request_uri", "/", "method", "POST", "user_id", 123); - log::println(&l, "request_uri", "/sign-in", "method", "GET"); - log::println(&l, "request_uri", "/dashboard", "method", "GET", "user_id", 123); + // use the normal log::println function + log::println("request_uri", "/", "method", "POST", "user_id", 123); + log::println("request_uri", "/sign-in", "method", "GET"); + log::println("request_uri", "/dashboard", "method", "GET", "user_id", 123); }; ``` -- 2.45.2