logging/logentry.js

'use strict';

/**
 * @author schukai GmbH
 */

import {Monster} from '../namespace.js';
import {validateInteger} from '../types/validate.js';
import {Base} from  '../types/base.js';


/**
 * you can call the method via the monster namespace `new Monster.Logging.LogEntry()`.
 *
 * ```
 * <script type="module">
 * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.6.0/dist/modules/logging/logentry.js';
 * console.log(new Monster.Logging.LogEntry())
 * </script>
 * ```
 *
 * Alternatively, you can also integrate this function individually.
 *
 * ```
 * <script type="module">
 * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.6.0/dist/modules/logging/logentry.js';
 * console.log(new LogEntry())
 * </script>
 * ```
 *
 * @since 1.5.0
 * @copyright schukai GmbH
 * @memberOf Monster/Logging
 */
class LogEntry extends Base {
    /**
     *
     * @param {int} loglevel
     * @param {*} args
     */
    constructor(loglevel, ...args) {
        super();
        validateInteger(loglevel);

        this.loglevel = loglevel
        this.arguments = args
    }

    /**
     *
     * @returns {integerr}
     */
    getLogLevel() {
        return this.loglevel
    }

    /**
     *
     * @returns {array}
     */
    getArguments() {
        return this.arguments
    }

}

Monster.assignToNamespace('Monster.Logging', LogEntry);
export {Monster, LogEntry}