~blainsmith/hare-logfmt

25c9392948c83c5dd70d829bd9f8a0088e1b7b6c — Blain Smith 2 years ago ed1379f
fix readme example
1 files changed, 7 insertions(+), 4 deletions(-)

M README.md
M README.md => README.md +7 -4
@@ 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);
};
```