Skip to content

Commit 14f06fe

Browse files
updated docs.
1 parent 44a4796 commit 14f06fe

File tree

3 files changed

+48
-6
lines changed

3 files changed

+48
-6
lines changed

docs/ch/user-guide/helper-reference/logging.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,31 @@ page_id: "080.050"
3232
参数可以像格式化字符串和变量的printf格式一样传递. 举例, 像这样:
3333

3434
```c++
35-
tError("Invalid Parameter : value : %d", value);
35+
tError("Invalid Parameter, value : %d", value);
3636
```
3737
3838
然后, 下面的记录将会输出到*log/app.log*文件:
3939
4040
```
41-
2011-04-01 21:06:04 ERROR [12345678] Invalid Parameter : value : -1
41+
2011-04-01 21:06:04 ERROR [12345678] Invalid Parameter, value : -1
4242
```
4343
4444
在格式化字符串的尾部不需要换行符.
4545
46+
在 TreeFrog 2.10 及更高版本中,如果编译器支持 stdc++20,则可以使用以下方法来描述 std::format 样式格式化.
47+
48+
* Tf::fatal()
49+
* Tf::error()
50+
* Tf::warn()
51+
* Tf::info()
52+
* Tf::debug()
53+
* Tf::trace()
54+
55+
其写法如下:
56+
```c++
57+
Tf::error("Invalid Parameter, value : {}", value);
58+
```
59+
4660
## 更改记录的布局
4761

4862
通过设置FileLogger能够改变记录输出的布局. 布局参数在配置文件*logger.ini*中.

docs/en/user-guide/helper-reference/logging.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,31 @@ The application log is used for logging your Web application. There are several
3232
Arguments that can be passed here are the same as the printf-format of format string and a variable number. For example, like this:
3333

3434
```c++
35-
tError("Invalid Parameter : value : %d", value);
35+
tError("Invalid Parameter, value : %d", value);
3636
```
3737
3838
Then, the following log will be output to the *log/app.log* file:
3939
4040
```
41-
2011-04-01 21:06:04 ERROR [12345678] Invalid Parameter : value : -1
41+
2011-04-01 21:06:04 ERROR [12345678] Invalid Parameter, value : -1
4242
```
4343
4444
Line feed code is not required at the end of the format string.
4545
46+
In TreeFrog version 2.10 and later, if the compiler supports stdc++20, you can use the following methods to describe std::format style formatting.
47+
48+
* Tf::fatal()
49+
* Tf::error()
50+
* Tf::warn()
51+
* Tf::info()
52+
* Tf::debug()
53+
* Tf::trace()
54+
55+
It can be written as follows:
56+
```c++
57+
Tf::error("Invalid Parameter, value : {}", value);
58+
```
59+
4660
## Changing Log Layout
4761

4862
It is possible to change the layout of the log output, by setting FileLogger.Layout parameters in the configuration file *logger.ini*.

docs/ja/user-guide/helper-reference/logging.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,31 @@ Webアプリは、以下の4つのログを出力します。
3232
渡せる引数は printf 形式と同じで、フォーマット文字列と可変個の変数です。例えば、こんな感じに使います。
3333

3434
```c++
35-
tError("Invalid Parameter : value : %d", value);
35+
tError("Invalid Parameter, value : %d", value);
3636
```
3737
3838
すると、次のようなログが log/app.log ファイルに出力されるでしょう。
3939
4040
```
41-
2011-04-01 21:06:04 ERROR [12345678] Invalid Parameter : value : -1
41+
2011-04-01 21:06:04 ERROR [12345678] Invalid Parameter, value : -1
4242
```
4343
4444
フォーマット文字列の末尾には改行コードは不要です。
4545
46+
TreeFrog バージョン2.10以降では、stdc++20をサポートしたコンパイラであれば、次のメソッドで std::format スタイルの書式を記述できます。
47+
48+
* Tf::fatal()
49+
* Tf::error()
50+
* Tf::warn()
51+
* Tf::info()
52+
* Tf::debug()
53+
* Tf::trace()
54+
55+
次のように記述できます。
56+
```c++
57+
Tf::error("Invalid Parameter, value : {}", value);
58+
```
59+
4660
## ログのレイアウト変更
4761

4862
出力されるログのレイアウトを変更することが可能です。logger.ini 設定ファイルにある FileLogger.Layout パラメータに設定します。

0 commit comments

Comments
 (0)