Skip to content

Commit

Permalink
20-25% inc
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmarkclements committed Mar 7, 2016
1 parent af46c49 commit c897432
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,22 @@ If more args follows `msg`, these will be used to format `msg` using
As far as I know, it is the fastest logger in town:

```
benchBunyan*10000: 1128ms
benchWinston*10000: 1903ms
benchBole*10000: 1511ms
benchPino*10000: 439ms
benchBunyanObj*10000: 1209ms
benchWinstonObj*10000: 1948ms
benchPinoObj*10000: 526ms
benchBoleObj*10000: 1466ms
benchBunyan*10000: 1064ms
benchWinston*10000: 1827ms
benchBole*10000: 1524ms
benchPino*10000: 438ms
benchBunyanObj*10000: 1220ms
benchWinstonObj*10000: 2119ms
benchPinoObj*10000: 524ms
benchBoleObj*10000: 1522ms
benchBunyan*10000: 1116.721ms
benchWinston*10000: 1783.362ms
benchBole*10000: 1496.580ms
benchPino*10000: 363.430ms
benchBunyanObj*10000: 1228.538ms
benchWinstonObj*10000: 1895.251ms
benchPinoObj*10000: 427.989ms
benchBoleObj*10000: 1487.543ms
benchBunyan*10000: 1088.231ms
benchWinston*10000: 1733.589ms
benchBole*10000: 1514.004ms
benchPino*10000: 377.418ms
benchBunyanObj*10000: 1205.833ms
benchWinstonObj*10000: 1800.594ms
benchPinoObj*10000: 412.170ms
benchBoleObj*10000: 1522.469ms
```

<a name="rotate"></a>
Expand Down
18 changes: 9 additions & 9 deletions pino.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function pino (opts, stream) {
if (!msg && obj instanceof Error) {
msg = obj.message
}
var data = JSON.stringify(new Message(num, msg))
var data = message(num, msg)
if (obj) {
data = data.slice(0, data.length - 1)

Expand All @@ -109,14 +109,14 @@ function pino (opts, stream) {
return data + '\n'
}

function Message (level, msg) {
this.pid = pid
this.hostname = hostname
this.name = name
this.level = level
this.msg = msg && msg.toString()
this.time = new Date()
this.v = 0
function message (level, msg) {
return '{"pid":' + pid + ',' +
(typeof hostname === 'undefined' ? '' : '"hostname":"' + hostname + '",') +
(typeof name === 'undefined' ? '' : '"name":"' + name + '",') +
'"level":' + level + ',' +
(typeof msg === 'undefined' ? '' : '"msg":"' + (msg && msg.toString()) + '",') +
'"time":"' + (new Date()).toISOString() + '",' +
'"v":' + 0 + '}'
}
}

Expand Down

0 comments on commit c897432

Please sign in to comment.