facebook / facebook/proxygen

Migrate from GLOG to Folly logging

Đang mở
#409 1 bình luận 0 reaction 1 người được giao Được @naclander nhận Xem trên GitHub
blocked enhancement
Ngôn ngữ chính
C++
Star
8.4k
Fork
1.5k
Merge trung bình
10 phút
Pull request đã merge (30 ngày)
2

Mô tả

We’re migrating Proxygen from using GLOG to Folly logging which is more flexible, natively supports async logging and has a number of [other advantages](https://github.com/facebook/folly/blob/main/folly/logging/docs/Comparisons.md).

General configuration instructions are [here](https://github.com/facebook/folly/blob/main/folly/logging/docs/Usage.md#configuration).

Notably, this means anything running Proxygen lib will need to use a different logging config, replacing `-v` and `--vmodule` with a matching config passed to `--logging`.

For example, if you wanted to print all logs up to V2, except in `myprojectroot/proxygen/lib/transport/H3DatagramAsyncSocket.cpp` and `myprojectroot/proxygen/lib/transport/PersistentFizzPskCache.cpp`, where you wanted to silence all the verbose logs entirely, then you might have run your binary with something like this:

```
-v=2 --vmodule=H3DatagramAsyncSocket*=0,PersistentFizzPskCache*=0
```

But now you would run it with:

```
--logging=DBG2,myprojectroot.proxygen.lib.transport.H3DatagramAsyncSocket:=INFO,myprojectroot.proxygen.lib.transport.PersistentFizzPskCache:=INFO
```

As another example, to exclude all verbose logging across the entire codebase and to exclude all logging (not just verbose) only from the files under `proxygen/lib/transport/`, you might run it with:

```
--logging=INFO,myprojectroot.proxygen.lib.transport:=MAX_LEVEL
```

If you use custom log sinks with GLOG, you will need to migrate them to [Folly Log Handlers](https://github.com/facebook/folly/blob/main/folly/logging/docs/LogHandlers.md) and if you use the `GOOGLE_STRIP_LOG` macro, you will need to use the corresponding value for `FOLLY_XLOG_MIN_LEVEL`.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.