Skip to content

Commit

Permalink
log-to-file > logtofile
Browse files Browse the repository at this point in the history
  • Loading branch information
sdolard committed Dec 24, 2011
1 parent edb6a37 commit cce5acd
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 31 deletions.
45 changes: 24 additions & 21 deletions README.md
@@ -1,4 +1,4 @@
# node-log-to-file
# node-logtofile
A simple log writer for node js.
Rotation and compression (gzip) are supported.

Expand All @@ -12,10 +12,10 @@ Rotation and compression (gzip) are supported.
curl http://npmjs.org/install.sh || sh
```

### Installing log-to-file
### Installing logtofile

```
[sudo] npm install [-g] log-to-file
[sudo] npm install [-g] logtofile
```


Expand Down Expand Up @@ -62,7 +62,7 @@ log.write("hello world");

```
### Generated files
log-to-file will create log files following this naming convention:
logtofile will create log files following this naming convention:
original: fileName [+ '.' + fileExt]
rotation: filename [+ '.' + fileExt] + '.' + fileIndex
compression: filename [+ '.' + fileExt] + '.' + fileIndex + '.gz'
Expand Down Expand Up @@ -127,26 +127,29 @@ Returns a LogToFile instance.
Just run test/run_test.js

## Bench
Just run test/log-to-file-bench.js
Just run test/logtofile-bench.js

```
Bench on my MacBook Pro OS X 10.6.8, 2.53GHz Intel Core 2 Duo (P8700), 7200 HDD with node 0.6.1:
Running bench 0. fileMaxSize: 5.00MB, maxBackupFileNumber: 0, gzipBackupFile: 0
................Total:1.00GB in 12704ms: 80.60MB/s
Running bench 1. fileMaxSize: 5.00MB, maxBackupFileNumber: 0, gzipBackupFile: 1
................Total:1.00GB in 13965ms: 73.33MB/s
Running bench 2. fileMaxSize: 5.00MB, maxBackupFileNumber: 5, gzipBackupFile: 0
................Total:1.00GB in 11047ms: 92.69MB/s
Running bench 3. fileMaxSize: 5.00MB, maxBackupFileNumber: 5, gzipBackupFile: 1
................Total:1.00GB in 19520ms: 52.46MB/s
Running bench 4. fileMaxSize: 5.00MB, maxBackupFileNumber: 10, gzipBackupFile: 0
................Total:1.00GB in 11074ms: 92.47MB/s
Running bench 5. fileMaxSize: 5.00MB, maxBackupFileNumber: 10, gzipBackupFile: 1
................Total:1.00GB in 22329ms: 45.86MB/s
Running bench 6. fileMaxSize: 10.00MB, maxBackupFileNumber: 10, gzipBackupFile: 0
................Total:1.00GB in 10976ms: 93.29MB/s
Running bench 7. fileMaxSize: 10.00MB, maxBackupFileNumber: 10, gzipBackupFile: 1
................Total:1.00GB in 24251ms: 42.23MB/s
................Total:1.00GB in 22237ms: 46.05MB/s
Running bench 1. fileMaxSize: 5.00MB, maxBackupFileNumber: 1, gzipBackupFile: 0
................Total:1.00GB in 20359ms: 50.30MB/s
Running bench 2. fileMaxSize: 5.00MB, maxBackupFileNumber: 1, gzipBackupFile: 1
................Total:1.00GB in 26732ms: 38.31MB/s
Running bench 3. fileMaxSize: 5.00MB, maxBackupFileNumber: 5, gzipBackupFile: 0
................Total:1.00GB in 19261ms: 53.16MB/s
Running bench 4. fileMaxSize: 5.00MB, maxBackupFileNumber: 5, gzipBackupFile: 1
................Total:1.00GB in 27426ms: 37.34MB/s
Running bench 5. fileMaxSize: 5.00MB, maxBackupFileNumber: 10, gzipBackupFile: 0
................Total:1.00GB in 19366ms: 52.88MB/s
Running bench 6. fileMaxSize: 5.00MB, maxBackupFileNumber: 10, gzipBackupFile: 1
................Total:1.00GB in 30814ms: 33.23MB/s
Running bench 7. fileMaxSize: 10.00MB, maxBackupFileNumber: 10, gzipBackupFile: 0
................Total:1.00GB in 19676ms: 52.04MB/s
Running bench 8. fileMaxSize: 10.00MB, maxBackupFileNumber: 10, gzipBackupFile: 1
................Total:1.00GB in 33875ms: 30.23MB/s
All done
```
Expand Down Expand Up @@ -175,4 +178,4 @@ All done


## License
node-log-to-file is licensed under the MIT license.
node-logtofile is licensed under the MIT license.
File renamed without changes.
12 changes: 6 additions & 6 deletions package.json
@@ -1,5 +1,5 @@
{
"name": "log-to-file",
"name": "logtofile",
"description": "A simple log writer. Rotation and compression (gzip) are supported.",
"version": "0.1.2",
"author": "Sebastien Dolard <sdolard@gmail.com>",
Expand All @@ -11,9 +11,9 @@
],
"repository": {
"type": "git",
"url": "git://github.com/sdolard/node-log-to-file.git"
"url": "git://github.com/sdolard/node-logtofile.git"
},
"main": "lib/log-to-file",
"main": "lib/logtofile",
"license": "MIT",
"scripts": {
"test": "node test/run_test.js"
Expand All @@ -22,15 +22,15 @@
"node": ">= 0.6.0"
},
"bugs": {
"url": "https://github.com/sdolard/node-log-to-file/issues"
"url": "https://github.com/sdolard/node-logtofile/issues"
},
"licenses": [
{
"type": "MIT",
"url": "https://raw.github.com/sdolard/node-log-to-file/master/LICENSE"
"url": "https://raw.github.com/sdolard/node-logtofile/master/LICENSE"
}
],
"dependencies": {},
"devDependencies": {},
"homepage": "http://github.com/sdolard/node-log-to-file"
"homepage": "http://github.com/sdolard/node-logtofile"
}
2 changes: 1 addition & 1 deletion test/log-to-file-backup.js → test/logtofile-backup.js
Expand Up @@ -25,7 +25,7 @@ assert = require('assert'),
path = require('path'),
util = require('util'),
fs = require('fs'),
logToFile = require('../lib/log-to-file'),
logToFile = require('../lib/logtofile'),
dataTest = [
'1234567890AZERTYUIOPQSDFGHJKLMWXCVBN',
'&é"(§è!çà)-azertyuiop^qsdfghjklmù`xcvbn,;:='
Expand Down
2 changes: 1 addition & 1 deletion test/log-to-file-bench.js → test/logtofile-bench.js
Expand Up @@ -2,7 +2,7 @@ var
path = require('path'),
util = require('util'),
fs = require('fs'),
logToFile = require('../lib/log-to-file'),
logToFile = require('../lib/logtofile'),
dataTest = '0',
ONE_K = 1024,
ONE_M = ONE_K * 1024,
Expand Down
2 changes: 1 addition & 1 deletion test/log-to-file-gz.js → test/logtofile-gz.js
Expand Up @@ -26,7 +26,7 @@ path = require('path'),
util = require('util'),
fs = require('fs'),
zlib = require('zlib'),
logToFile = require('../lib/log-to-file'),
logToFile = require('../lib/logtofile'),
dataTest = [
'1234567890AZERTYUIOPQSDFGHJKLMWXCVBN',
'&é"(§è!çà)-azertyuiop^qsdfghjklmù`xcvbn,;:='
Expand Down
2 changes: 1 addition & 1 deletion test/log-to-file.js → test/logtofile.js
Expand Up @@ -25,7 +25,7 @@ assert = require('assert'),
path = require('path'),
util = require('util'),
fs = require('fs'),
logToFile = require('../lib/log-to-file'),
logToFile = require('../lib/logtofile'),
dataTest = [
'1234567890AZERTYUIOPQSDFGHJKLMWXCVBN',
'&é"(§è!çà)-azertyuiop^qsdfghjklmù`xcvbn,;:='
Expand Down

0 comments on commit cce5acd

Please sign in to comment.