Skip to content

Commit

Permalink
v3.3.3 released
Browse files Browse the repository at this point in the history
  • Loading branch information
Maizify committed Aug 17, 2019
1 parent 5451ca9 commit 909cbd5
Show file tree
Hide file tree
Showing 9 changed files with 2,481 additions and 2,619 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
English | [简体中文](./CHANGELOG_CN.md)

#### V3.3.3 (2019-08-18)

- [FEATURE] Add `%c` log format to support custom log style, see [Tutorial](./doc/tutorial.md) for more details.
- [FEATURE] Add `VConsole.VConsoleLogPlugin` (`VConsole.VConsole*` plugins etc.) to `VConsole` class.
- [IMPROVE] Display vConsole on `window DOMContentLoaded` instead of `window load`.
- [FIX] Fix remove cookie fail when it is set path=/ or top domain. (#264 by @qianxinfeng)
- [FIX] Fix a few minor issues. (#267 by @Molunerfinn, #272 by @domom)


#### V3.3.2 (2019-07-04)

- [FEATURE] Add TypeScript definition file. (by by @jas0ncn)
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG_CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
[English](./CHANGELOG.md) | 简体中文

#### V3.3.3 (2019-08-18)

- 【特性】增加 `%c` 以支持自定义日志样式,详情见 [使用教程](./doc/tutorial_CN.md)
- 【特性】增加 `VConsole.VConsoleLogPlugin``VConsole.VConsole*` 内置插件在 `VConsole` class 上的挂载。
- 【优化】在 `window DOMContentLoaded` 而不是 `window load` 时显示 vConsole。
- 【修复】修复当 cookie `path=/` 或设置了 `domain` 时删除失败的问题。(#264 by @qianxinfeng)
- 【修复】修复若干小问题。(#267 by @Molunerfinn, #272 by @domom)


#### V3.3.2 (2019-07-04)

- 【特性】增加 TypeScript 声明文件。(by @jas0ncn
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ Import `dist/vconsole.min.js` to your project:
</script>
```

For TypeScript users:

```javascript
import 'path/to/vconsole.min.d.ts';
```

See [Tutorial](./doc/tutorial.md) for more details.


Expand Down
6 changes: 6 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ npm install vconsole
</script>
```

对于 TypeScript,可引入 d.ts 文件:

```javascript
import 'path/to/vconsole.min.d.ts';
```

详细使用方法请参阅[使用教程](./doc/tutorial_CN.md)


Expand Down
4 changes: 2 additions & 2 deletions dist/vconsole.min.js

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions doc/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,20 @@ console.log('UserID:', uid); // UserID: 233
```


### Styled log

Use `%c` to add style to logs:

```javascript
console.log('%c blue %c red', 'color:blue', 'color:red'); // blue red
console.log('%c FOO', 'font-weight:bold', 'bar'); // FOO bar
console.log('%c Foo %c bar', 'color:red'); // Foo %c bar
```

Note that only first parameter support `%c` format, and the following parameter(s) will be used as HTML style to fill `%c`, and the remain `%c` or parameters will be shown as normal logs.



### Special format

Use `[system]` as the first parameter to print logs to System tab:
Expand Down
15 changes: 15 additions & 0 deletions doc/tutorial_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,21 @@ var uid = 233;
console.log('UserID:', uid); // 打印出 UserID: 233
```


### 样式

可使用 `%c` 来添加样式:

```javascript
console.log('%c blue %c red', 'color:blue', 'color:red'); // blue red
console.log('%c FOO', 'font-weight:bold', 'bar'); // FOO bar
console.log('%c Foo %c bar', 'color:red'); // Foo %c bar
```

只有第一个参数支持 `%c` 格式,一旦出现 `%c` 格式,后续的字符串参数将作为 HTML style 样式来替换 `%c`;未被替换的 `%c`、剩余的参数,将作为默认日志照常输出。



### 特殊格式

支持使用 `[system]` 作为第一个参数,来将 log 输出到 System 面板:
Expand Down
Loading

0 comments on commit 909cbd5

Please sign in to comment.