This commit is contained in:
freearhey
2026-05-02 12:26:32 +03:00
parent 834abac5e4
commit 6826742c6b
3 changed files with 163 additions and 140 deletions

View File

@@ -167,6 +167,7 @@ export async function loadIssues(props?: { labels: string | string[] }) {
per_page: 100,
labels,
status: 'open',
direction: 'asc',
headers: {
'X-GitHub-Api-Version': '2022-11-28'
}
@@ -293,3 +294,33 @@ function parseDiscussion(discussion: {
data: new DataSet(data)
})
}
class LogThread {
issue: Issue
type: string
constructor(issue: Issue, type: string) {
this.issue = issue
this.type = type
}
start() {
console.log(`[#${this.issue.number}] ${this.type}: Issue #${this.issue.number}`)
}
warn(message: string) {
console.log(`[#${this.issue.number}] ${this.type}: └── WARNING: ${message}`)
}
error(message: string) {
console.log(`[#${this.issue.number}] ${this.type}: └── ERROR: ${message}`)
}
info(message: string) {
console.log(`[#${this.issue.number}] ${this.type}: └── INFO: ${message}`)
}
}
export function createThread(issue: Issue, type: string): LogThread {
return new LogThread(issue, type)
}