electron-log
Advanced tools
Comparing version 4.3.2 to 4.3.3
{ | ||
"name": "electron-log", | ||
"version": "4.3.2", | ||
"version": "4.3.3", | ||
"description": "Just a very simple logging module for your Electron application", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -80,7 +80,10 @@ # electron-log | ||
- **fileName**, default 'main.log', 'renderer.log' or 'worker.log' | ||
- **[format](docs/format.md)**, default | ||
`'[{y}-{m}-{d} {h}:{i}:{s}.{ms}] [{level}] {text}'` | ||
- **level**, default 'silly' | ||
- **maxSize** of log file in bytes, 1048576 (1mb) by default. | ||
- **resolvePath** function sets the log path, for example | ||
```js | ||
log.transports.file.resolvePath = () => path.join(APP_DATA, 'logs/main.log'); | ||
``` | ||
@@ -87,0 +90,0 @@ [Read more about file transport](docs/file.md). |
@@ -60,2 +60,8 @@ 'use strict'; | ||
/** | ||
* @type {boolean} | ||
* @private | ||
*/ | ||
this.hasActiveAsyncWritting = false; | ||
/** | ||
* @type {WriteOptions} | ||
@@ -183,3 +189,3 @@ * @private | ||
if (this.asyncWriteQueue.length < 1) { | ||
if (this.hasActiveAsyncWritting || this.asyncWriteQueue.length < 1) { | ||
return; | ||
@@ -189,4 +195,7 @@ } | ||
var text = this.asyncWriteQueue.shift(); | ||
this.hasActiveAsyncWritting = true; | ||
fs.writeFile(this.path, text, this.writeOptions, function (e) { | ||
file.hasActiveAsyncWritting = false; | ||
if (e) { | ||
@@ -193,0 +202,0 @@ file.emit( |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
104294
38
3060
206
13