Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Commit a85d2c1

Browse files
committed
fix logging issue
1 parent 5e4c2b6 commit a85d2c1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@log4js2/core",
3-
"version": "2.0.3",
3+
"version": "2.0.4",
44
"scripts": {
55
"build": "tsc",
66
"lint": "tslint -p tsconfig.json -c tslint.json",

src/layout/formatter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ export class Formatter {
494494
if (typeof define !== 'undefined') {
495495
const path = require('path');
496496
let appDir = path.dirname(require.main.filename);
497-
if (!fileParts[0].startsWith(appDir)) {
497+
if (!fileParts[0] || !fileParts[0].startsWith(appDir)) {
498498
appDir = '';
499499
}
500500
logEvent.filename = fileParts.join(':').replace(appDir, '').replace(/^([\\\/])/, '');

0 commit comments

Comments
 (0)