abumq / easyloggingpp

C++ logging library. It is powerful, supports asynchronous low latency, extendable, light-weight, fast performing, thread and type safe and consists of many built-in features. It provides ability to write logs in your own customized format. It also provide support for logging your classes, third-party libraries, STL and third-party containers etc.
MIT License
3.79k stars 927 forks source link

Add strict permissions flag #800

Open MisterTea opened 3 years ago

MisterTea commented 3 years ago

Hey all! Thanks for creating a beautiful and simple logging library.

We use easyloggingpp in Eternal Terminal ( https://github.com/MisterTea/EternalTerminal ) and would like the logs to only be readable by the user and group that created them (especially for logs created by root). This PR adds a compile flag for that.

A couple of points:

  1. I'm not sure if a compile flag is the right approach, but it looked like creating an option would require us to pass the option all the way down to file creation, which could be a much bigger change.
  2. If the flag is on, I try to bring in std::filesystem to ensure that the correct permissions are set on unix and windows. If this is too large of a footprint, we could do it only for unix.

This is a

I have