Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
idealvin committed Nov 8, 2021
1 parent f8e886e commit 4c32e7b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ If users want to create coroutine in all scheduling threads, the following way c

```cpp
auto& s = co::all_schedulers();
for (size_t i = 0; i <s.size(); ++i) {
for (size_t i = 0; i < s.size(); ++i) {
s[i]->go(f);
}
```
Expand All @@ -124,7 +124,7 @@ DEF_main(argc, argv) {

int v = 0;
ch >> v;
LOG << "v: "<< v;
LOG << "v: " << v;

return 0;
}
Expand Down Expand Up @@ -158,9 +158,9 @@ DEF_main(argc, argv) {
co::WaitGroup wg;
wg.add(8);

for (int i = 0; i <8; ++i) {
for (int i = 0; i < 8; ++i) {
go([wg]() {
LOG << "co: "<< co::coroutine_id();
LOG << "co: " << co::coroutine_id();
wg.done();
});
}
Expand Down Expand Up @@ -252,7 +252,7 @@ co/flag provides a default value for each config item. Without config parameters
```cpp
// xx.cc
#include "co/flag.h"
#include "co/log.h"
#include "co/cout.h"

DEF_bool(x, false, "bool x");
DEF_bool(y, false, "bool y");
Expand Down Expand Up @@ -293,11 +293,11 @@ The above is an example of using co/flag. The macro at the beginning of `DEF_` i
co/log divides the log into five levels: debug, info, warning, error, and fatal. **Printing a fatal level log will terminate the program**. Users can print logs of different levels as follows:

```cpp
DLOG << "hello "<< 23; // debug
LOG << "hello "<< 23; // info
WLOG << "hello "<< 23; // warning
ELOG << "hello "<< 23; // error
FLOG << "hello "<< 23; // fatal
DLOG << "hello " << 23; // debug
LOG << "hello " << 23; // info
WLOG << "hello " << 23; // warning
ELOG << "hello " << 23; // error
FLOG << "hello " << 23; // fatal
```

co/log also provides a series of `CHECK` macros, which can be regarded as an enhanced version of `assert`, and they will not be cleared in debug mode.
Expand Down
2 changes: 1 addition & 1 deletion readme_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ co/flag 为每个配置项提供一个默认值,在没有配置参数的情况
```cpp
// xx.cc
#include "co/flag.h"
#include "co/log.h"
#include "co/cout.h"

DEF_bool(x, false, "bool x");
DEF_bool(y, false, "bool y");
Expand Down

0 comments on commit 4c32e7b

Please sign in to comment.