Skip to content

Commit 8555396

Browse files
committed
node: allow for unlimited breadcrumbs in FileBreadcrumbsStorage
1 parent 91630f0 commit 8555396

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/node/src/breadcrumbs/FileBreadcrumbsStorage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class FileBreadcrumbsStorage implements BreadcrumbsStorage {
3838
_fileSystem,
3939
_mainFile,
4040
_fallbackFile,
41-
Math.floor((this._limits.maximumBreadcrumbs ?? 100) / 2),
41+
this._limits.maximumBreadcrumbs ? Math.floor(this._limits.maximumBreadcrumbs / 2) : undefined,
4242
this._limits.maximumBreadcrumbsSize,
4343
);
4444
}

packages/node/src/common/AlternatingFileWriter.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class AlternatingFileWriter {
1414
private readonly _fileSystem: NodeFileSystem,
1515
private readonly _mainFile: string,
1616
private readonly _fallbackFile: string,
17-
private readonly _maxLines: number,
17+
private readonly _maxLines?: number,
1818
private readonly _maxSize?: number,
1919
) {}
2020

@@ -64,11 +64,11 @@ export class AlternatingFileWriter {
6464

6565
const logLength = log.length + 1;
6666

67-
if (currentCount + 1 > this._maxLines) {
67+
if (currentCount + 1 > (this._maxLines ?? Infinity)) {
6868
break;
6969
}
7070

71-
if (this._maxSize && currentSize + logLength >= this._maxSize) {
71+
if (currentSize + logLength >= (this._maxSize ?? Infinity)) {
7272
break;
7373
}
7474

@@ -106,7 +106,7 @@ export class AlternatingFileWriter {
106106
private prepareBreadcrumbStream(newSize: number) {
107107
if (!this._fileStream) {
108108
this._fileStream = this.safeCreateStream(this._mainFile);
109-
} else if (this._count >= this._maxLines || (this._maxSize && this._size + newSize >= this._maxSize)) {
109+
} else if (this._count >= (this._maxLines ?? Infinity) || this._size + newSize >= (this._maxSize ?? Infinity)) {
110110
this.switchFile();
111111
}
112112
}

0 commit comments

Comments
 (0)