Skip to content

Commit 3fbd398

Browse files
committed
UPD | docs: system logs
1 parent 83f2524 commit 3fbd398

File tree

4 files changed

+41
-4
lines changed

4 files changed

+41
-4
lines changed

docs/content/docs/data-formats/json.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: JSON
33
description: JSON Support in ManapiHttp
44
---
55

6-
# JSON in C++
6+
## JSON in C++
77
By default, C++ does not have built-in JSON support.
88
To address this, ManapiHttp provides a JSON implementation in the ```<manapihttp/json/ManapiJson.hpp>``` header file.
99

@@ -243,7 +243,7 @@ manapi::json data = {{"data", "hello"}, {"hello", "data"}};
243243
manapi::json data = {{"data", "hello"}, {"hello", "data"}};
244244
245245
// Insert a new key-value pair
246-
data.insert({{"world", "hello"}});
246+
data.insert({"world", "hello"});
247247
248248
// Remove a key
249249
data.erase("world");

docs/content/docs/intro/quick-start.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ title: Quick Start
33
description: Getting Started with Coding
44
---
55

6-
After installation, include the library in your CMakeLists.txt.
7-
86
## Preparation
97

8+
After installation, include the library in your CMakeLists.txt.
109
Import the ManapiHttp library into your project.
1110

1211
### Using System Libraries (Default)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: System Logs
3+
description: Setting Up System Logging
4+
---
5+
6+
ManapiHttp provides 5 levels of system logging:
7+
8+
- **```LOG_TRACE_NONE```**
9+
No debug output
10+
11+
- **```LOG_TRACE_HIGH```**
12+
Only critical messages will be printed
13+
14+
- **```LOG_TRACE_MEDIUM```**
15+
Some less important messages will also be printed
16+
17+
- **```LOG_TRACE_LOW```**
18+
Almost all messages will be printed
19+
20+
- **```LOG_TRACE_HARD```**
21+
All debug messages will be printed, including messages from TimerLoop, EventLoop, TCP and UDP
22+
23+
<Callout title="Note">
24+
In release mode, messages with the ```LOG_TRACE_HARD``` level are removed.
25+
</Callout>
26+
27+
```cpp
28+
#include <manapihttp/ManapiInitTools.hpp> // manapi::init_tools::log_trace_init
29+
#include <manapihttp/ManapiDebug.hpp> // manapi_log_trace
30+
31+
int main(int argc, char *argv[]) {
32+
// System log initialization (not thread-safe)
33+
manapi::init_tools::log_trace_init(manapi::debug::LOG_TRACE_HIGH);
34+
// Print message (method is blocking and thread-safe)
35+
manapi_log_trace(manapi::debug::LOG_TRACE_HIGH, "Application has started!");
36+
}
37+
```

docs/content/docs/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"---Introduction---",
55
"intro/install",
66
"intro/quick-start",
7+
"intro/syslogs",
78
"---Data Formats---",
89
"data-formats/json"
910
]

0 commit comments

Comments
 (0)