2

I have a React app into which I'm trying to install a logger. Loglevel seemed like a good bet and simple.

I installed it via NPM,

npm install -D loglevel

and included it in my React app (which, for what it's worth, was created with create-react-app)

import * as log from 'loglevel'

and tried to use it

    log.debug(`APP.JS: onAcknowledgeGameOver: NICKNAME: ${nickname}, GAMEID: ${gameID}, THIS.STATE.NICKNAME: ${this.state.nickname}`)

but I get no log in the console. What am I doing wrong? Thanks for any help!

Cerulean
  • 5,543
  • 9
  • 59
  • 111

1 Answers1

3

Ah, you have to

log.setLevel('debug')

first -- apparently the default is some higher (lower) level

Cerulean
  • 5,543
  • 9
  • 59
  • 111