Skip to content

Commit fca745e

Browse files
committed
docs: synced via GitHub Actions
1 parent 1d1212f commit fca745e

File tree

4 files changed

+365
-1
lines changed

4 files changed

+365
-1
lines changed

src/dev-guide/debug.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ Nop平台启动时会使用类扫描机制查找所有`_vfs`目录下的虚拟
8989
logInfo("nop.err.invalid-name:name={}",name);
9090
```
9191

92-
第一个参数必须是静态字符串,不允许"sss"+yyy这种形式,从而也避免了log注入攻击。
92+
第一个参数必须是静态字符串,不允许"sss"+yyy这种形式,从而也避免了log注入攻击。注意第一个参数使用了slf4j框架的日志消息模板语法,必须通过`{}`来表示变量占位。
93+
94+
日志函数的具体实现参见 `LogFunctions.java``LogHelper.java`
9395

9496
### 2. 任意对象调用$函数都会导致打印调试语句
9597

@@ -208,6 +210,18 @@ nop-config模块负责从多个配置来源收集配置信息,并按照优先
208210
`/p/DevDoc__graphql`
209211
返回graphql定义
210212

213+
### 6. 调试模型合并过程
214+
215+
`x:gen-extends`或者 `x:post-extends`段中增加日志输出代码或者通过扩展属性来输出调试信息。
216+
217+
```xml
218+
<orm>
219+
<x:gen-extends>
220+
<orm ext:time="${now()}" xgen:x:dump="true" />
221+
</x:gen-extends>
222+
</orm>
223+
```
224+
211225
## 自动化测试
212226

213227
1. 自动录制的response中变量名可能不正确

src/dev-guide/xlang/xscript.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@ result = xpl('my:MyTag',1, x+3)
9191
| _ | 对应于Underscore类 |
9292
| $config | 对应于AppConfig类 |
9393

94+
## 扩展属性
95+
实现了IPropGetMissingHook和IPropSetMissingHook扩展接口,在脚本代码或者表达式语言中就可以访问动态实体属性时,形式与访问普通属性相同。
96+
97+
```typescript
98+
entity.extField = 3;
99+
100+
// 等价于
101+
entity.prop_set('extField',3);
102+
```
103+
94104
## 特定上下文变量
95105

96106
* `codeGenerator`: `XCodeGenerator`类型,`precompile`目录下的代码生成模板中可用

src/faq/faq.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,17 @@ public MyUserPageBean findAll(){
474474
class MyUserPageBean extends MyPageBean<User>{}
475475
```
476476

477+
### 40. logInfo没有打印出数据
478+
479+
```javascript
480+
logInfo("data",data);
481+
```
482+
logInfo函数的第一个参数是模板消息字符串,使用slf4j日志框架的语法,需要使用`{}`来表示变量占位
483+
484+
```javascript
485+
logInfo("data: {}",data);
486+
```
487+
477488
## 部署问题
478489

479490
## 设计问题

0 commit comments

Comments
 (0)