Skip to content

Commit 93fa849

Browse files
author
Umutcan ÖNER
committed
feat(core): add formatMessage utility function
- Added formatMessage function to format messages with ISO timestamp - This will be useful for consistent logging across the application
1 parent 4873e13 commit 93fa849

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/core/src/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,14 @@ export function validateInput(input: string): boolean {
1717
return input.trim().length > 0;
1818
}
1919

20+
/**
21+
* Format a message with timestamp for logging
22+
* @param message - The message to format
23+
* @returns Formatted message with timestamp
24+
*/
25+
export function formatMessage(message: string): string {
26+
const timestamp = new Date().toISOString();
27+
return `[${timestamp}] ${message}`;
28+
}
29+
2030
export * from './types';

0 commit comments

Comments
 (0)