We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 808cc79 commit bf76792Copy full SHA for bf76792
packages/logger/tests/unit/logBuffer.test.ts
@@ -197,6 +197,17 @@ describe('Buffer logs', () => {
197
);
198
});
199
200
+ it('it safely short circuits when clearBuffer is called without a trace id', () => {
201
+ // Prepare
202
+ process.env._X_AMZN_TRACE_ID = undefined;
203
+ const logger = new Logger({
204
+ logLevel: LogLevel.ERROR,
205
+ logBufferOptions: { enabled: true, bufferAtVerbosity: LogLevel.DEBUG },
206
+ });
207
+
208
+ // Assess
209
+ expect(() => logger.clearBuffer()).not.toThrow();
210
211
it('it flushes the buffer when an error in logged', () => {
212
// Prepare
213
const logger = new Logger({
0 commit comments