log(level, head, ...args) {
        // 1st arg is the log level/type
        let strLevel
        switch (level) {
            case 'trace':
            case 5: {
                level = 5 // make sure level is numeric
                strLevel = 'trace'
                break
            }

            case 'debug':
            case 4: {
                level = 4
                strLevel = 'debug'
                break
            }

            case 'log':
            case 3: {
                level = 3
                strLevel = 'log'
                break
            }

            case 'info':
            case '':
            case 2: {
                level = 2
                strLevel = 'info'
                break
            }

            case 'warn':
            case 1: {
                level = 1
                strLevel = 'warn'
                break
            }

            case 'error':
            case 'err':
            case 0: {
                level = 0
                strLevel = 'error'
                break
            }

            default: {
                level = -1
                break
            }

        }

        // If set to something unknown, no log output
        if (level > this.logLevel || level === -1) return

        let stack = ['no stack']
        try {
            // @ts-ignore
            stack = (new Error().stack).split('\n')
            stack.shift(); stack.shift()
        } catch (e) { }
        const logMethod = console[this.LOG_STYLES[strLevel].console]
        logMethod(`%c${this.LOG_STYLES[strLevel].pre}${strLevel}%c [${head}]`, `${this.LOG_STYLES.level} ${this.LOG_STYLES[strLevel].css}`, `${this.LOG_STYLES.head} ${this.LOG_STYLES[strLevel].txtCss}`, ...args, `(${stack.join('/n').trim()})`)

        // if (level > this.logLevel || level === -1) return function () { }
        // return Function.prototype.bind.call(
        //     console[this.LOG_STYLES[strLevel].console],
        //     console,
        //     `%c${this.LOG_STYLES[strLevel].pre}${strLevel}%c [${head}]`, `${this.LOG_STYLES.level} ${this.LOG_STYLES[strLevel].css}`, `${this.LOG_STYLES.head} ${this.LOG_STYLES[strLevel].txtCss}`,
        //     ...args, new Error().stack
        // )()
    }
Output a log msg to the browser dev console if the output level >= log level
NOTE: The old Function.prototype.bind.call method always returned the location
   of the actual call to log BUT required that the log call had and extra func
   call. e.g. log(...)().
   The new version does not require that but as a compromise, uses `new Error().stack
   to display the call location. This might not work in all browsers.
@param {*} level Log level (0-5, error-trace)
@param {*} head Text to be used at start of log output wrapped in [...]
@param  {...any} args any other arguments. Passed on to the underlying console.... function