-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b9efb44
commit a899e5a
Showing
4 changed files
with
51 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,36 @@ | ||
import { colors, ConsoleHandler, log } from "./deps.ts"; | ||
import { colors, ConsoleHandler, log } from './deps.ts' | ||
|
||
type Arkive = { | ||
name: string | ||
majorVersion: number | ||
minorVersion: number | ||
id: number | ||
} | ||
|
||
export class ArkiveConsoleLogHandler extends ConsoleHandler { | ||
private arkiveName: string; | ||
private arkiveId: number; | ||
private arkiveVersion: number; | ||
private arkive: Arkive | ||
|
||
constructor( | ||
levelName: log.LevelName, | ||
options: log.HandlerOptions & { | ||
arkiveName: string; | ||
arkiveId: number; | ||
arkiveVersion: number; | ||
}, | ||
) { | ||
super(levelName, options); | ||
this.arkiveName = options.arkiveName; | ||
this.arkiveId = options.arkiveId; | ||
this.arkiveVersion = options.arkiveVersion; | ||
} | ||
constructor( | ||
levelName: log.LevelName, | ||
options: log.HandlerOptions & { | ||
arkive: Arkive | ||
}, | ||
) { | ||
super(levelName, options) | ||
this.arkive = options.arkive | ||
} | ||
|
||
override format(logRecord: log.LogRecord): string { | ||
let msg = super.format(logRecord); | ||
override format(logRecord: log.LogRecord): string { | ||
let msg = super.format(logRecord) | ||
|
||
msg = `${ | ||
colors.blue( | ||
`[${this.arkiveId}-${this.arkiveName}@v${this.arkiveVersion}]`, | ||
) | ||
} ${msg}`; | ||
msg = `${ | ||
colors.blue( | ||
`[${this.arkive.id}:${this.arkive.name}@v${this.arkive.majorVersion}.${this.arkive.minorVersion}]`, | ||
) | ||
} ${msg}` | ||
|
||
return msg; | ||
} | ||
return msg | ||
} | ||
} | ||
|
||
export const logger = () => log.getLogger("arkiver"); | ||
export const logger = () => log.getLogger('arkiver') |
a899e5a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
robo-arkiver-docs – ./
robo-arkiver-docs-git-main-robo-vault.vercel.app
robo-arkiver-docs.vercel.app
docs.arkiver.robolabs.biz
robo-arkiver-docs-robo-vault.vercel.app