src/shared/console.js
function generateLevelMap () {
  LEVELS.forEach(level => {
    const levelIndex = LEVELS.indexOf(level)
    levelMap[level] = {}
    LEVELS.forEach(type => {
      const typeIndex = LEVELS.indexOf(type)
      if (typeIndex <= levelIndex) {
        levelMap[level][type] = true
      }
    })
  })
}
function generateLevelMap () {
  LEVELS.forEach(level => {
    const levelIndex = LEVELS.indexOf(level)
    levelMap[level] = {}
    LEVELS.forEach(type => {
      const typeIndex = LEVELS.indexOf(type)
      if (typeIndex <= levelIndex) {
        levelMap[level][type] = true
      }
    })
  })
}
function generateLevelMap ( ) { LEVELS . forEach ( level => { const levelIndex = LEVELS . indexOf ( level ) levelMap [ level ] = { } LEVELS . forEach ( type => { const typeIndex = LEVELS . indexOf ( type ) if ( typeIndex <= levelIndex ) { levelMap [ level ] [ type ] = true } } ) } ) }
Generate map for which types of message will be sent in a certain message level
as the order of LEVELS.
Generate map for which types of message will be sent in a certain message level as the order of LEVELS .