Skip to content

Conversation

@grypez
Copy link
Contributor

@grypez grypez commented Apr 22, 2025

Refs: #217

  • creates a new @ocap/logger package
  • moves the Logger class from @ocap/utils to @ocap/logger
  • replaces deprecated makeLogger calls with new Logger in refactored packages
  • standardizes log labels to kebab-lower-case in affected logger construction routines
  • removes the deprecated makeLogger factory from the monorepo

@socket-security
Copy link

socket-security bot commented Apr 22, 2025

@socket-security
Copy link

socket-security bot commented Apr 22, 2025

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

@grypez grypez force-pushed the grypez/add-logger-package branch 5 times, most recently from 0515527 to 2f60400 Compare April 22, 2025 18:26
@grypez grypez marked this pull request as ready for review April 22, 2025 18:41
@grypez grypez requested a review from a team as a code owner April 22, 2025 18:41
@grypez grypez changed the title refactor: promote logger out of utils refactor: promote logger to its own package Apr 22, 2025
@grypez grypez force-pushed the grypez/add-logger-package branch from 2f60400 to 2a76d18 Compare April 22, 2025 20:45
Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Some questions / suggestions.

Comment on lines +13 to +34
/**
* Parses the options for the logger.
*
* @param options - The options for the logger.
* @returns The parsed options.
*/
export const parseOptions = (
options: LoggerOptions | string | undefined,
): LoggerOptions => {
// The default case catches whatever is not explicitly handled below.
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
switch (typeof options) {
case 'object':
return options;
case 'string':
return { tags: [options], transports: [consoleTransport] };
case 'undefined':
return { transports: [consoleTransport] };
default:
throw new Error('Invalid logger options');
}
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are a lot of options. We could just use an options bag instead. Does not need to be actioned in this PR.

@grypez grypez force-pushed the grypez/add-logger-package branch from 3f43248 to 8969312 Compare April 23, 2025 18:00
rekmarks
rekmarks previously approved these changes Apr 23, 2025
Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some conflicts snuck in but otherwise LGTM!

@grypez grypez force-pushed the grypez/add-logger-package branch from a5c5845 to 076e45c Compare April 23, 2025 21:36
@grypez grypez enabled auto-merge (squash) April 24, 2025 01:50
Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@grypez grypez merged commit 53dd80f into main Apr 24, 2025
21 checks passed
@grypez grypez deleted the grypez/add-logger-package branch April 24, 2025 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants