How to use the trace function from loglevel

Find comprehensive JavaScript loglevel.trace code examples handpicked from public code repositorys.

38
39
40
41
42
43
44
45
46
47
/**
 * @param {boolean} [ignoreStderr]
 * @returns {string}
 */
build(ignoreStderr) {
  log.trace('build()', this);
  let cmd = this.cmd;
  for (const arg of this.args) {
    cmd += ' ' + arg;
  }
fork icon114
star icon466
watch icon5

+ 15 other calls in file

100
101
102
103
104
105
106
107
108
    if ('--ald' in features) {
      this.params.ald = data.params.ald || features['--ald'].default;
      assertContains(features['--ald'].options, this.params.ald, 'Invalid --ald');
    }


    log.trace(LogFormatter.format().full(this));
  }
};
fork icon113
star icon463
watch icon5

+ 4 other calls in file

1
2
3
4
5
6
7
8
9
10
11
12
13


const loglevel = require('loglevel');


loglevel.setLevel(parseInt(process.env.LOG_LEVEL || 0));


const trace = loglevel.trace;
const debug = loglevel.debug;
const info  = loglevel.info;
const warn  = loglevel.warn;
const error = loglevel.error;
fork icon0
star icon1
watch icon2

3
4
5
6
7
8
9
10
11
12
13


(async () => {
    try {
        log.setLevel(0)
        
        log.trace('trace')
        log.debug('debug')
        log.info('info')
        log.warn('warn', 'kjhgfbdcxz')
        log.error('error')
fork icon0
star icon1
watch icon0

29
30
31
32
33
34
35
36
37
38
const fetchStoveStatus = async (args) => {
  const {conf, stove, mqtt} = args
  let status
  try {
    status = await stove.getStatus()
    log.trace(status)
  } catch (e) {
    log.warn('fail to get status')
    log.warn(e)
  }
fork icon0
star icon0
watch icon0