![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-ui/view/base/web/js/lib/logger/ |
/** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ 'moment', 'mage/utils/template' ], function (moment, mageTemplate) { 'use strict'; /** * @param {String} dateFormat * @param {String} template */ function LogFormatter(dateFormat, template) { /** * @protected * @type {String} */ this.dateFormat_ = 'YYYY-MM-DD hh:mm:ss'; /** * @protected * @type {String} */ this.template_ = '[${ $.date }] [${ $.entry.levelName }] ${ $.message }'; if (dateFormat) { this.dateFormat_ = dateFormat; } if (template) { this.template_ = template; } } /** * @param {LogEntry} entry * @returns {String} */ LogFormatter.prototype.process = function (entry) { var message = mageTemplate.template(entry.message, entry.data), date = moment(entry.timestamp).format(this.dateFormat_); return mageTemplate.template(this.template_, { date: date, entry: entry, message: message }); }; return LogFormatter; });