Skip to content

Commit 097072e

Browse files
committed
fix: logger path prefix for linux
1 parent 7ea6fc7 commit 097072e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/BytebeamLogger.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,15 @@ class BytebeamLogger {
7373
// get the module string
7474
String moduleObj = String(module);
7575

76-
int startIdx = moduleObj.lastIndexOf('\\') + 1;
76+
int startIdx = moduleObj.lastIndexOf('\\');
77+
78+
//fix for linux
79+
if (startIdx == -1){
80+
startIdx = moduleObj.lastIndexOf('/');
81+
}
82+
83+
startIdx += 1;
84+
7785
int endIdx = moduleObj.lastIndexOf('.');
7886

7987
moduleObj = moduleObj.substring(startIdx, endIdx);

0 commit comments

Comments
 (0)