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

JS: Add extensibility point to supply a custom logging function #1789

Merged
merged 2 commits into from Mar 22, 2024

Conversation

exyi
Copy link
Member

@exyi exyi commented Mar 1, 2024

No description provided.

* Instead of calling console.log, console.warn or console.error, DotVVM will call this function instead.
* Please keep in mind that the exact wording of error message is not DotVVM public API and may change without notice.
* @example
* dotvvm.log.setLogger((previous, level, area, ...args) => {
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer naming to next

@@ -4,6 +4,26 @@ type LogLevel = "normal" | "verbose";

export const level = getLogLevel();

let logger = function defaultLogger(level: "warn" | "log" | "error" | "trace", area: DotvvmLoggingArea, ...args: any) {
Copy link
Member

Choose a reason for hiding this comment

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

Export the list of levels as type to prevent repeating

@exyi exyi marked this pull request as ready for review March 22, 2024 12:47
@exyi exyi added this to the Version 4.3 milestone Mar 22, 2024
@tomasherceg tomasherceg merged commit 6a6b6ec into main Mar 22, 2024
14 of 15 checks passed
@tomasherceg tomasherceg deleted the js-custom-logger branch March 22, 2024 13:35
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.

None yet

2 participants