Skip to content

Commit 8f64ff0

Browse files
committed
test: advanced logger use case
1 parent ee8860e commit 8f64ff0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packages/commons/src/Utility.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@
5151
* ```
5252
*/
5353
export class Utility {
54-
#initializationType: 'unknown' | 'on-demand' | 'provisioned-concurrency';
54+
readonly #initializationType:
55+
| 'unknown'
56+
| 'on-demand'
57+
| 'provisioned-concurrency';
5558
protected coldStart = true;
5659
protected readonly defaultServiceName: string = 'service_undefined';
5760

packages/logger/tests/e2e/advancedUses.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { RESOURCE_NAME_PREFIX, STACK_OUTPUT_LOG_GROUP } from './constants.js';
1212
* In this e2e test for Logger, we test a number of advanced use cases:
1313
* - Log buffering enabled with flush on error (both manually on logger.error and automatically on uncaught error)
1414
* - Correlation ID injection (both manually and automatically)
15+
* - Cold start detection for provisioned concurrency (always false)
1516
*
1617
* The test is split into three cases:
1718
* - Manual instrumentation
@@ -127,6 +128,7 @@ describe('Logger E2E - Advanced uses', () => {
127128
expect.objectContaining({
128129
level: 'INFO',
129130
message: 'an info log',
131+
cold_start: false,
130132
correlation_id: correlationId,
131133
})
132134
);
@@ -136,6 +138,7 @@ describe('Logger E2E - Advanced uses', () => {
136138
expect.objectContaining({
137139
level: 'DEBUG',
138140
message: 'a buffered debug log',
141+
cold_start: false,
139142
correlation_id: correlationId,
140143
})
141144
);
@@ -145,6 +148,7 @@ describe('Logger E2E - Advanced uses', () => {
145148
expect.objectContaining({
146149
level: 'ERROR',
147150
message: 'Uncaught error detected, flushing log buffer before exit',
151+
cold_start: false,
148152
correlation_id: correlationId,
149153
error: expect.objectContaining({
150154
name: 'Error',

0 commit comments

Comments
 (0)