diff --git a/changelog/1.4.0.md b/changelog/1.4.0.md index 03cc9ae4..3928a71a 100644 --- a/changelog/1.4.0.md +++ b/changelog/1.4.0.md @@ -12,6 +12,7 @@ Contents: - [oatpp::Tree](#oatpptree) - [Remapper](#remapper) - [oatpp::web::mime::ContentMappers](#oatppwebmimecontentmappers) +- [New OATPP_LOGx format](#new-oatpp_logx-format) - [Restructuring](#restructuring) @@ -149,6 +150,29 @@ on `Content-Type`/`Accept` headers. } ``` +## New OATPP_LOGx format + +Now oatpp logs are type-safe. Also log formatting changed. + +#### Macro + +| old logs | new logs | +|--------------|--------------| +| `OATPP_LOGV` | `OATPP_LOGv` | +| `OATPP_LOGD` | `OATPP_LOGd` | +| `OATPP_LOGI` | `OATPP_LOGi` | +| `OATPP_LOGW` | `OATPP_LOGw` | +| `OATPP_LOGE` | `OATPP_LOGe` | + +#### Formatting + +Instead of old formatting "%s", "%d", "%f" use "{}" for any variable type: + +```cpp +OATPP_LOGd("MyController", "User: name={}, age={}", user->name, user->age) +``` + + ## Restructuring ### Files