addHook(hookName, callback) {
        let hooks;

        if (!this.hooks[hookName]) {
            this.hooks[hookName] = [];
        }

        hooks = this.hooks[hookName];

        // exclude repeat hook
        let isRepeat = false;
        for (let i = 0; i < hooks.length; i++) {
            if (hooks[i] === callback) {
                isRepeat = true;
                break;
            }
        }

        if (isRepeat) {
            console.warn(`Repeat hook name:${hookName}`);
        } else {
            hooks.push(callback);
        }
    }
Add listener to plugin hooks system.

@param {string} hookName The hook name.
@param {Function} callback The listener function to add.