electron-log
Advanced tools
Comparing version 5.0.0-beta.1 to 5.0.0-beta.2
{ | ||
"name": "electron-log", | ||
"version": "5.0.0-beta.1", | ||
"version": "5.0.0-beta.2", | ||
"description": "Just a simple logging module for your Electron application", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -6,2 +6,5 @@ # electron-log | ||
New v5 beta is ready and I would be grateful | ||
[for any feedbacks](https://github.com/megahertz/electron-log/discussions/333). | ||
Simple logging module Electron/Node.js/NW.js application. | ||
@@ -12,5 +15,5 @@ No dependencies. No complicated configuration. | ||
- **on Linux:** `~/.config/{app name}/logs/{process type}.log` | ||
- **on macOS:** `~/Library/Logs/{app name}/{process type}.log` | ||
- **on Windows:** `%USERPROFILE%\AppData\Roaming\{app name}\logs\{process type}.log` | ||
- **on Linux:** `~/.config/{app name}/logs/main.log` | ||
- **on macOS:** `~/Library/Logs/{app name}/main.log` | ||
- **on Windows:** `%USERPROFILE%\AppData\Roaming\{app name}\logs\main.log` | ||
@@ -34,3 +37,3 @@ ## Installation | ||
// Optional, initialize logger for any renderer processses | ||
// Optional, initialize the logger for any renderer processses | ||
log.initialize({ preload: true }); | ||
@@ -50,2 +53,9 @@ | ||
If a bundler is used, you can just import the module: | ||
```typescript | ||
import log from 'electron-log/renderer'; | ||
log.info('Log from the renderer process'); | ||
``` | ||
There are a few other options how a logger can be initialized for a renderer | ||
@@ -52,0 +62,0 @@ process. [Read more](docs/initialize.md). |
@@ -412,7 +412,7 @@ import { RequestOptions } from 'http'; | ||
*/ | ||
onError?( | ||
onError?(options: { | ||
error: Error, | ||
versions?: { app: string; electron: string; os: string }, | ||
submitIssue?: (url: string, data: ReportData | any) => void, | ||
): void; | ||
versions: { app: string; electron: string; os: string }, | ||
createIssue: (url: string, data: ReportData | any) => void, | ||
}): void; | ||
} | ||
@@ -419,0 +419,0 @@ |
@@ -10,3 +10,3 @@ 'use strict'; | ||
bytesWritten = 0; | ||
hasActiveAsyncWritting = false; | ||
hasActiveAsyncWriting = false; | ||
path = null; | ||
@@ -89,11 +89,12 @@ initialSize = undefined; | ||
if (this.hasActiveAsyncWritting || this.asyncWriteQueue.length < 1) { | ||
if (this.hasActiveAsyncWriting || this.asyncWriteQueue.length === 0) { | ||
return; | ||
} | ||
const text = this.asyncWriteQueue.shift(); | ||
this.hasActiveAsyncWritting = true; | ||
const text = this.asyncWriteQueue.join(''); | ||
this.asyncWriteQueue = []; | ||
this.hasActiveAsyncWriting = true; | ||
fs.writeFile(this.path, text, this.writeOptions, function (e) { | ||
file.hasActiveAsyncWritting = false; | ||
fs.writeFile(this.path, text, this.writeOptions, (e) => { | ||
file.hasActiveAsyncWriting = false; | ||
@@ -100,0 +101,0 @@ if (e) { |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
107284
3289
228
2