blob: d1c0d9d770805f689b6fa7a32b1f3d51c636c531 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
import env from 'std-env'
import Consola from './consola'
import Reporters from './reporters'
// Attach consola to the global to prevent
// duplicated instances when used with different packages/versions
let consola = global && global.consola
if (!consola) {
consola = new Consola({
level: env.debug ? 4 : 3
})
if (env.minimalCLI) {
consola.add(new Reporters.BasicReporter())
} else {
consola.add(new Reporters.FancyReporter())
}
Object.assign(consola, { Consola }, Reporters)
global.consola = consola
}
export default consola
|