electron-log
Advanced tools
Comparing version 4.4.7 to 4.4.8
{ | ||
"name": "electron-log", | ||
"version": "4.4.7", | ||
"version": "4.4.8", | ||
"description": "Just a very simple logging module for your Electron application", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -247,3 +247,5 @@ import { RequestOptions } from 'http'; | ||
*/ | ||
readAllLogs(): Array<{ path: string, lines: string[] }>; | ||
readAllLogs( | ||
options?: { fileFilter?: (logPath: string) => boolean } | ||
): Array<{ path: string, lines: string[] }>; | ||
@@ -250,0 +252,0 @@ /** |
@@ -117,3 +117,7 @@ 'use strict'; | ||
function readAllLogs() { | ||
function readAllLogs(options) { | ||
var fileFilter = options && typeof options.fileFilter === 'function' | ||
? options.fileFilter | ||
: function (fileName) { return fileName.endsWith('.log') }; | ||
var vars = Object.assign({}, pathVariables, { | ||
@@ -125,4 +129,5 @@ fileName: transport.fileName, | ||
return fs.readdirSync(logsPath) | ||
.map(function (fileName) { | ||
var logPath = path.join(logsPath, fileName); | ||
.map(function (fileName) { return path.join(logsPath, fileName) }) | ||
.filter(fileFilter) | ||
.map(function (logPath) { | ||
try { | ||
@@ -129,0 +134,0 @@ return { |
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
103470
3116