Unverified Commit 9b843378 authored by Gabi Melman's avatar Gabi Melman Committed by GitHub

Update README.md

parent a4665c27
......@@ -86,20 +86,7 @@ int main()
}
```
#### Load log levels from env variable or from argv
```c++
#include "spdlog/cfg/env.h"
void load_levels_example()
{
// Set the log level to "info" and mylogger to to "trace":
// SPDLOG_LEVEL=info,mylogger=trace && ./example
spdlog::cfg::load_env_levels();
// or from command line:
// ./example SPDLOG_LEVEL=info,mylogger=trace
// #include "spdlog/cfg/argv.h" // for loading levels from argv
// spdlog::cfg::load_argv_levels(args, argv);
}
```
---
#### Create stdout/stderr logger object
```c++
#include "spdlog/spdlog.h"
......@@ -112,6 +99,7 @@ void stdout_example()
spdlog::get("console")->info("loggers can be retrieved from a global registry using the spdlog::get(logger_name)");
}
```
---
#### Basic file logger
```c++
......@@ -326,7 +314,6 @@ void err_handler_example()
```
---
#### syslog
```c++
......@@ -350,6 +337,22 @@ void android_example()
}
```
---
#### Load log levels from env variable or from argv
```c++
#include "spdlog/cfg/env.h"
void load_levels_example()
{
// Set the log level to "info" and mylogger to to "trace":
// SPDLOG_LEVEL=info,mylogger=trace && ./example
spdlog::cfg::load_env_levels();
// or from command line:
// ./example SPDLOG_LEVEL=info,mylogger=trace
// #include "spdlog/cfg/argv.h" // for loading levels from argv
// spdlog::cfg::load_argv_levels(args, argv);
}
```
## Benchmarks
Below are some [benchmarks](https://github.com/gabime/spdlog/blob/v1.x/bench/bench.cpp) done in Ubuntu 64 bit, Intel i7-4770 CPU @ 3.40GHz
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment