Skip to content

Commit 0784839

Browse files
committed
Fix logger path scoping
1 parent 55a42ca commit 0784839

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/core/Logger.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { getFolderwrapping, isWindows } from './helpers/Path';
2+
13
/**
24
* core.log.Log
35
* ------------------------------------------------
@@ -30,10 +32,11 @@ export class Logger {
3032
private static Adapters: Map<string, interfaces.LoggerAdapterConstructor> = new Map();
3133

3234
private static parsePathToScope(path: string): string {
33-
if (path.indexOf('/') >= 0) {
35+
const pathDelimiter = isWindows() ? '\\' : '/';
36+
if (path.indexOf(pathDelimiter) >= 0) {
3437
path = path.replace(process.cwd(), '');
35-
path = path.replace('/src/', '');
36-
path = path.replace('/dist/', '');
38+
path = path.replace(getFolderwrapping('src'), '');
39+
path = path.replace(getFolderwrapping('dist'), '');
3740
path = path.replace('.ts', '');
3841
path = path.replace('.js', '');
3942
path = path.replace(/\//g, ':');

0 commit comments

Comments
 (0)