This repository has been archived by the owner on Mar 18, 2022. It is now read-only.
forked from typeorm/typeorm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: log files loaded from glob patterns (typeorm#4346)
This new feature logs the files that are loaded using the glob patterns to aid in debugging. Closes: typeorm#4162
- Loading branch information
Showing
5 changed files
with
47 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Troubleshooting | ||
|
||
* [Glob patterns](#glob-patterns) | ||
|
||
## Glob Patterns | ||
|
||
Glob patterns are used in the TypeOrm to specify the locations of entities, migrations, subscriber and other information. Errors in the patterns can lead to the common `RepositoryNotFoundError` and familiar errors. In order to check if any files were loaded by TypeOrm using the glob patterns, all you need to do is set the logging level to `info` such as explained in the [Logging](./logging.md) section of the documentation. This will allow you to have logs in the console that may look like this: | ||
|
||
```bash | ||
# in case of an error | ||
INFO: No classes were found using the provided glob pattern: "dist/**/*.entity{.ts}" | ||
``` | ||
```bash | ||
# when files are found | ||
INFO: All classes found using provided glob pattern "dist/**/*.entity{.js,.ts}" : "dist/app/user/user.entity.js | dist/app/common/common.entity.js" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# 故障排除 | ||
|
||
* [全球模式](#全球模式) | ||
|
||
## 全球模式 | ||
|
||
在类型中使用全局模式来指定实体,迁移,订户和其他信息的位置。模式中的错误可能导致常见的`RepositoryNotFoundError`和熟悉的错误。为了检查TypeOrm是否使用glob模式加载了任何文件,您需要做的就是将日志级别设置为`info`,如文档的[Logging](./logging.md)部分所述。 这将允许您拥有可能如下所示的日志: | ||
|
||
```bash | ||
# 如果出错 | ||
INFO: No classes were found using the provided glob pattern: "dist/**/*.entity{.ts}" | ||
``` | ||
```bash | ||
# 何时找到文件 | ||
INFO: All classes found using provided glob pattern "dist/**/*.entity{.js,.ts}" : "dist/app/user/user.entity.js | dist/app/common/common.entity.js" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters