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

feat: [lean4web] rewrite logger to be compatible with browser #494

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions vscode-lean4/src/utils/logger.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import { Console } from 'console'

class Logger extends Console {
constructor(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream) {
super(stdout, stderr)
}

class Logger {
private static now(): string {
const now = new Date()
return (
Expand All @@ -19,13 +13,13 @@ class Logger extends Console {
}

log(msg: string) {
super.log(Logger.now(), '-', msg)
console.log(Logger.now(), '-', msg)
}

error(msg: string) {
super.error(Logger.now(), '-', msg)
console.error(Logger.now(), '-', msg)
}
}

const logger = new Logger(process.stdout, process.stderr)
const logger = new Logger()
export { logger }
Loading