Skip to content

Commit

Permalink
add log limit macros
Browse files Browse the repository at this point in the history
  • Loading branch information
odygrd committed Jun 17, 2023
1 parent c5bf839 commit 0c0cfb5
Show file tree
Hide file tree
Showing 5 changed files with 198 additions and 3 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- [v3.1.0](#v310)
- [v3.0.2](#v302)
- [v3.0.1](#v301)
- [v3.0.0](#v300)
Expand Down Expand Up @@ -46,6 +47,18 @@
- [v1.1.0](#v110)
- [v1.0.0](#v100)

## v3.1.0

- It is now possible to set a minimum logging interval for specific logs. For example:

```c++
for (uint64_t i = 0; i < 10; ++i)
{
LOG_INFO_LIMIT(2000, default_logger, "log in a loop with limit 1 message every 2000 micros for i {}", i);
std::this_thread::sleep_for(std::chrono::microseconds{1000});
}
```
## v3.0.2
- Add missing header on clang when `QUILL_X86ARCH` is defined.
Expand Down
10 changes: 10 additions & 0 deletions examples/example_trivial.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include "quill/Quill.h"

#include <chrono>
#include <thread>

/**
* Trivial logging example
*/
Expand Down Expand Up @@ -99,4 +102,11 @@ int main()
}

LOG_INFO(default_logger, "Existing logger names {}", logger_names);

for (uint64_t i = 0; i < 10; ++i)
{
LOG_INFO_LIMIT(2000, default_logger,
"log in a loop with limit 1 message every 2000 micros for i {}", i);
std::this_thread::sleep_for(std::chrono::microseconds{1000});
}
}
4 changes: 2 additions & 2 deletions quill/include/quill/Quill.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ namespace quill

/** Version Info **/
constexpr uint32_t VersionMajor{3};
constexpr uint32_t VersionMinor{0};
constexpr uint32_t VersionPatch{2};
constexpr uint32_t VersionMinor{1};
constexpr uint32_t VersionPatch{0};
constexpr uint32_t Version{VersionMajor * 10000 + VersionMinor * 100 + VersionPatch};

/** forward declarations **/
Expand Down
Loading

0 comments on commit 0c0cfb5

Please sign in to comment.