Skip to content

Commit

Permalink
Fix colored browser logging
Browse files Browse the repository at this point in the history
  • Loading branch information
holtwick committed Oct 23, 2023
1 parent 21da873 commit 856d951
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/browser/log/log-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,22 @@ export function LoggerBrowserHandler(opt: LogHandlerOptions = {}): LogHandler {
case LogLevelInfo:
if (opt.levelHelper)
args[0] = `I|* ${args[0]}`
console.info(...joinLogStrings(...args))
console.info(...args)
break
case LogLevelWarn:
if (opt.levelHelper)
args[0] = `W|** ${args[0]}`
console.warn(...joinLogStrings(...args))
console.warn(...args)
break
case LogLevelError:
if (opt.levelHelper)
args[0] = `E|*** ${args[0]}`
console.error(...joinLogStrings(...args))
console.error(...args)
break
default:
if (opt.levelHelper)
args[0] = `D| ${args[0]}`
console.debug(...joinLogStrings(...args))
console.debug(...args)
break
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/common/data/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ export function fromHex(hexString: string): Uint8Array {
)
}

// Learn about Base64 in browsers: https://web.dev/articles/base64-encoding

/** Regular base64 */
export function toBase64(bin: BinInput, stripPadding = false): string {
const bytes = toUint8Array(bin)
Expand Down

0 comments on commit 856d951

Please sign in to comment.