Skip to content

Commit

Permalink
merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
latel committed Jan 29, 2017
2 parents 1217c36 + 219eb0f commit 33492df
Show file tree
Hide file tree
Showing 28 changed files with 1,722 additions and 1,410 deletions.
4 changes: 2 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": [ "es2015" ]
}
"presets": [ "es2015-rollup" ]
}
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ indent_size = 4
[*.json]
# 缩进2个空格
indent_size = 2

[makefile]
indent_style = tab
22 changes: 14 additions & 8 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
v1.0.4
U use rollup.js bundler to reduce dist package size(33% off)
A add makefile, use make for automatic procedures
U replace comments in English
A add `get` method to get logs in suitable time range, rename `getAll` to `all`

V1.0.3
F indexDB使用自增键作为主键,修复在高频存储调用过程中会报错的问题(因为唯一keypath timestamp可能会重复)
U 优化了localStorage协议的存储结构,节省空间
F add auto-increase as key of IndexedDB, to fix error when logging in high frequency(old keypath timestamp may repeat)
U updated localStorage protocol's storage structer to save spaces

V1.0.2
A 自动按照协议的优先级选择可用的协议,优先级来自构建时的参数
A 自定义数据库名
A ability to choose protocol automatically
A custom database name

V1.0.1
D 解耦日志上传功能,api `reportTO` 和 `deploy` 被移除
D log upload api `reportTo` and `deploy` is removed,

V1.0.0
A 日志记录
A 日志上传
A 自定义构建,允许只打包业务需要的协议
A log record
A log upload
A custom build, allow build with only protocols wanted
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ access [https://github.com/latel/logline/releases](https://github.com/latel/logl

### 2. Import to your project
Logline is an UMD ready module, choose to import it as your project needed.
CMD is evil, which is not supported, wrapper it yourself if you need it indeed.

``` javascript
// using <script> element
Expand All @@ -84,7 +85,7 @@ you can use `using` method to specialfy a protocol.
Logline.using(Logline.PROTOCOL.WEBSQL);
```

***If you call Logline related APIs, without specialfy a protocol in advance***, Logline will choose a available protocol automatically, respect the priority according to the configuration parameters during the compile.
***If you call Logline related APIs, without specialfy a protocol in advance***, Logline will choose a available protocol automatically, respect the priority according to the configuration parameters during the compile process.

such as, your compile command is `npm run configure -- --with-indexeddb --with-websql --with-localstorage`,
if protocol indexeddb is available, then indexeddb protocol with be chosen automatically,
Expand Down Expand Up @@ -117,7 +118,18 @@ sdkLog.critical('system.vanish', {

### 5. Read logs
``` javascript
Logline.getAll(function(logs) {
// collect all logs
Logline.all(function(logs) {
// process logs here
});

// collet logs within .3 days
Logline.get('.3d', function(logs) {
// process logs here
});

// collect logs from 3 days before, and earlier than 1 days ago
Logline.get('3d', '1d', function(logs) {
// process logs here
});
```
Expand Down Expand Up @@ -160,10 +172,14 @@ FAQ
---

### How to upload logs
since v1.0.1, log upload ability is removed, as the upload procedures varies upon different projects, and we do hope Logline to focus on log recording and maintenance. Anyway, you can still use `Logline.getAll` to get the logs, and implement your own upload procedure.
since v1.0.1, log upload ability is removed, as the upload procedures varies upon different projects,
and we do hope Logline to focus on log recording and maintenance.
Anyway, you can still use `Logline.all` and `Logline.get` to get the logs,
and implement your own upload procedure.

### How to analysis
As the format Logline provited is standard with good readability, thus you can read the logs in the terminal or certain text editors.
As the format Logline provited is standard with good readability,
thus you can read the logs in the terminal or certain text editors.

We still provids [Logline-viewer] to helps you to do so.

Expand Down
17 changes: 15 additions & 2 deletions README.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ bower install logline
### 2. 引入脚本

Logline 支持直接使用 script 标签引用,也支持 AMD 模块加载器.
CMD是邪恶并且不被支持的,如果你真的需要请自己再包装一下。

``` javascript
// Script标签引入方式
Expand Down Expand Up @@ -117,7 +118,18 @@ sdkLog.critical('system.vanish', {
### 5. 读取日志

``` javascript
Logline.getAll(function(logs) {
// collect all logs
Logline.all(function(logs) {
// process logs here
});

// collet logs within .3 days
Logline.get('.3d', function(logs) {
// process logs here
});

// collect logs from 3 days before, and earlier than 1 days ago
Logline.get('3d', '1d', function(logs) {
// process logs here
});
```
Expand Down Expand Up @@ -163,7 +175,8 @@ FAQ
----

### 如何上传日志?
从v1.0.1以开始,日志上传功能被移除,我们希望logline更专注于日志的记录和维护工作,你可以通过`Logline.getAll`来获取日志来自行实现上传过程。
从v1.0.1以开始,日志上传功能被移除,我们希望logline更专注于日志的记录和维护工作,
你可以通过`Logline.all``Logline.get`来获取日志来自行实现上传过程。

### 如何分析日志
-------------
Expand Down
8 changes: 4 additions & 4 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
WIP
[ ] 不使用 webpack 编译,以减小打包文件的大小 HIGH
none

CONSIDERING
[ ] 完善错误处理细节 LOW
[ ] fullfill error handling LOW
[ ] 修复phantomjs无法正确测试indexeddb的问题,phantomjs在关闭数据后才能读取到新存储的内容 LOW
[ ] 添加标记,用于指示当前日志协议是否有未完成或者等待中的异步任务 LOW
[ ] 允许获取指定时间范围内的日志 NICE TO HAVE
[ ] add a tag, to indicate pending operations LOW
[ ] ability to get desired NICE TO HAVE
1 change: 1 addition & 0 deletions dist/dependencies.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
No third parties dependencies
Loading

0 comments on commit 33492df

Please sign in to comment.