Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecation(log): move handlers to single-export files #4176

Merged
merged 1 commit into from
Jan 12, 2024

Conversation

iuioiua
Copy link
Contributor

@iuioiua iuioiua commented Jan 12, 2024

Towards #4174

@iuioiua iuioiua requested a review from kt3k as a code owner January 12, 2024 04:45
@github-actions github-actions bot added the log label Jan 12, 2024
const DEFAULT_FORMATTER = "{levelName} {msg}";
export type FormatterFunction = (logRecord: LogRecord) => string;

export interface BaseHandlerOptions {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: this was previously HandlerOptions in handlers.ts.

*
* This handler requires `--allow-write` permission on the log file.
*/
export class FileHandler extends BaseHandler {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: this used to extend WriterHandler in handlers.ts.

@@ -137,6 +145,8 @@ interface FileHandlerOptions extends HandlerOptions {
* exists.
*
* This handler requires `--allow-write` permission on the log file.
*
* @deprecated (will be removed in 0.214.0) Import from {@link https://deno.land/std/log/file_handler.ts} instead.
*/
export class FileHandler extends WriterHandler {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: FileHandler extends BaseHandler in the new location.

}
}

override log(msg: string) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: this override is new. Shouldn't be breaking.

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

LGTM. Nice work!

@iuioiua iuioiua merged commit 3144d89 into main Jan 12, 2024
10 checks passed
@iuioiua iuioiua deleted the log-single-export-files-handlers branch January 12, 2024 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants