Skip to content

Commit

Permalink
feat: add instance name option
Browse files Browse the repository at this point in the history
  • Loading branch information
onurravli committed Nov 28, 2023
1 parent 1182f19 commit e6f53c9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/guvercin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,9 @@ export class Guvercin {
const level = logLevel
const textColor = LogColors[logLevel]
const separator = this.settings.separator
const name = this.settings.name
const textColored = `${name ? `(${name})` : ''} ${time} ${separator} ${textColor(
`[${chalk.bold(level)}]`
)} ${separator} ${message}`
const textNotColored = `${name ? `(${name})` : ''} ${time} ${separator} [${level}] ${separator} ${message}`
const name = this.settings.name == undefined ? '' : `(${this.settings.name}) `
const textColored = `${name}${time} ${separator} ${textColor(`[${chalk.bold(level)}]`)} ${separator} ${message}`
const textNotColored = `${name}${time} ${separator} [${level}] ${separator} ${message}`

// TODO: Add remote logging option
// fetch('http://localhost:3000/log', { method: 'POST', body: JSON.stringify({ time, level, message }) })
Expand Down

0 comments on commit e6f53c9

Please sign in to comment.