summaryrefslogtreecommitdiff
path: root/src/node_modules/consola/src/browser.js
blob: d39e1c11b6b6c2a1f7a8a12bb01a1f87c5bcf2a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import Consola from './consola.js'
import BrowserReporter from './reporters/browser.js'
import { LogLevel } from './logLevels'

function createConsola () {
  const consola = new Consola({
    reporters: [
      new BrowserReporter()
    ]
  })

  // Expose constructors
  consola.Consola = Consola
  consola.LogLevel = LogLevel
  consola.BrowserReporter = BrowserReporter

  return consola
}

export default (typeof window !== 'undefined' && window.consola) || createConsola()