Skip to content
Snippets Groups Projects
Verified Commit 669fae0e authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

chore: commit save point

parent fd5aa407
No related branches found
No related tags found
No related merge requests found
...@@ -73,7 +73,7 @@ We do try to work around some browser bugs, but on the whole we don't use polyfi ...@@ -73,7 +73,7 @@ We do try to work around some browser bugs, but on the whole we don't use polyfi
However, many functions can be mapped via [polyfill.io](https://polyfill.io/) and thus the compatibility can be increased. However, many functions can be mapped via [polyfill.io](https://polyfill.io/) and thus the compatibility can be increased.
```html ```html
<script id="polyfill" src="https://polyfill.io/v3/polyfill.min.js?feat" <script id="polyfill" src="https://polyfill.io/v3/polyfill.min.js?features=Array.from,Array.isArray,Array.prototype.entries,Array.prototype.fill,Array.prototype.filter,Array.prototype.forEach,Array.prototype.indexOf,Array.prototype.keys,Array.prototype.lastIndexOf,Array.prototype.map,Array.prototype.reduce,Array.prototype.sort,ArrayBuffer,atob,CustomEvent,DataView,document,Document,DocumentFragment,Element,Event,fetch,globalThis,HTMLDocument,HTMLTemplateElement,Intl,JSON,Map,Math.log2,Number.isInteger,Object.assign,Object.defineProperty,Object.entries,Object.freeze,Object.getOwnPropertyDescriptor,Object.getOwnPropertyNames,Object.getPrototypeOf,Object.keys,Promise,Reflect,Reflect.defineProperty,Reflect.get,Reflect.getOwnPropertyDescriptor,Reflect.setPrototypeOf,Set,String.prototype.endsWith,String.prototype.matchAll,String.prototype.padStart,String.prototype.startsWith,String.prototype.trim,Symbol,Symbol.iterator,Uint16Array,Uint8Array,URL,WeakMap,WeakSet"
crossorigin="anonymous" crossorigin="anonymous"
referrerpolicy="no-referrer"></script> referrerpolicy="no-referrer"></script>
``` ```
......
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html * License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/ */
import {Base} from '../../types/base.mjs';
import {getGlobalObject} from "../../types/global.mjs"; import {getGlobalObject} from "../../types/global.mjs";
import {Handler} from '../handler.mjs'; import {Handler} from '../handler.mjs';
import {LogEntry} from "../logentry.mjs"; import {LogEntry} from "../logentry.mjs";
import {TRACE, WARN, DEBUG, ERROR, FATAL, INFO} from "../logger.mjs";
export {ConsoleHandler} export {ConsoleHandler}
...@@ -38,7 +38,29 @@ export {ConsoleHandler} ...@@ -38,7 +38,29 @@ export {ConsoleHandler}
if (super.log(entry)) { if (super.log(entry)) {
let console = getGlobalObject('console'); let console = getGlobalObject('console');
if (!console) return false; if (!console) return false;
if (!console.error) console.error = console.log;
if (!console.warn) console.warn = console.log;
switch (entry.getLogLevel()) {
case TRACE:
case DEBUG:
case INFO:
console.log(entry.toString());
break;
case FATAL:
case ERROR:
console.error(entry.toString());
break;
case WARN:
console.warn(entry.toString());
break;
default:
console.log(entry.toString()); console.log(entry.toString());
break;
}
return true; return true;
} }
......
...@@ -21,11 +21,11 @@ test-browser-monster: create-polyfill-monster ...@@ -21,11 +21,11 @@ test-browser-monster: create-polyfill-monster
$(QUIET) $(SED) -i "1 i /** this file was created automatically by the make target test-browser-monster */" $(TEST_PATH)web/import.js $(QUIET) $(SED) -i "1 i /** this file was created automatically by the make target test-browser-monster */" $(TEST_PATH)web/import.js
$(ESBUILD) --platform=browser --sourcemap=inline --external:jsdom --external:process --external:crypto --bundle $(TEST_PATH)web/import.js --outfile=$(TEST_PATH)web/tests.js $(ESBUILD) --platform=browser --sourcemap=inline --external:jsdom --external:process --external:crypto --bundle $(TEST_PATH)web/import.js --outfile=$(TEST_PATH)web/tests.js
# $(QUIET) $(CD) $(MONSTER_BUILD_TEST_BROWSER_DIR); $(WEBPACK) ; $(CD) - # $(QUIET) $(CD) $(MONSTER_BUILD_TEST_BROWSER_DIR); $(WEBPACK) ; $(CD) -
$(QUIET) $(SED) -i -E "/<h1/s_.*_ <h1 style='margin-bottom: 0.1em;'>Monster $(PROJECT_VERSION)</h1>_" $(TEST_PATH)web/test.html $(TEST_PATH)web/monster.html $(TEST_PATH)web/monster-dev.html # $(QUIET) $(SED) -i -E "/<h1/s_.*_ <h1 style='margin-bottom: 0.1em;'>Monster $(PROJECT_VERSION)</h1>_" $(TEST_PATH)web/test.html $(TEST_PATH)web/monster.html $(TEST_PATH)web/monster-dev.html
$(QUIET) $(SED) -i -E "/id=\"lastupdate\"/s_.*_ <div id=\"lastupdate\" style='font-size:0.7em'>last update $(shell date)</div>_" $(TEST_PATH)web/test.html $(TEST_PATH)web/monster.html $(TEST_PATH)web/monster-dev.html # $(QUIET) $(SED) -i -E "/id=\"lastupdate\"/s_.*_ <div id=\"lastupdate\" style='font-size:0.7em'>last update $(shell date)</div>_" $(TEST_PATH)web/test.html $(TEST_PATH)web/monster.html $(TEST_PATH)web/monster-dev.html
$(QUIET) $(SED) -i -E "s_src=\"([\"]*)\.js.*\"_src=\"\1.js?r=$(shell date +"%T")\"_" $(TEST_PATH)web/test.html $(TEST_PATH)web/monster.html $(TEST_PATH)web/monster-dev.html # $(QUIET) $(SED) -i -E "s_src=\"([\"]*)\.js.*\"_src=\"\1.js?r=$(shell date +"%T")\"_" $(TEST_PATH)web/test.html $(TEST_PATH)web/monster.html $(TEST_PATH)web/monster-dev.html
$(QUIET) $(SED) -i -E "s_dist/([0-9]+\.[0-9]+\.[0-9]+)*/dist/monster_dist/$(PROJECT_VERSION)/dist/monster_" $(TEST_PATH)web/monster.html $(TEST_PATH)web/monster-dev.html # $(QUIET) $(SED) -i -E "s_dist/([0-9]+\.[0-9]+\.[0-9]+)*/dist/monster_dist/$(PROJECT_VERSION)/dist/monster_" $(TEST_PATH)web/monster.html $(TEST_PATH)web/monster-dev.html
#$(QUIET) if $(OPENBROWSER) ; then google-chrome --profile-directory="Default" $(TEST_PATH)web/test.html ; fi # #$(QUIET) if $(OPENBROWSER) ; then google-chrome --profile-directory="Default" $(TEST_PATH)web/test.html ; fi
.PHONY: web-to-s3 .PHONY: web-to-s3
......
...@@ -17,8 +17,5 @@ sed -i "1 i /** this file was created automatically by the make target test-brow ...@@ -17,8 +17,5 @@ sed -i "1 i /** this file was created automatically by the make target test-brow
npx esbuild --platform=browser --sourcemap=inline --external:jsdom --external:process --external:crypto --bundle ${TEST_PATH}web/import.js --outfile=${TEST_PATH}web/tests.js npx esbuild --platform=browser --sourcemap=inline --external:jsdom --external:process --external:crypto --bundle ${TEST_PATH}web/import.js --outfile=${TEST_PATH}web/tests.js
sed -i -E "/<h1/s_.*_ <h1 style='margin-bottom: 0.1em;'>Monster ${VERSION}</h1>_" ${TEST_PATH}web/test.html ${TEST_PATH}web/monster.html ${TEST_PATH}web/monster-dev.html
sed -i -E "/id=\"lastupdate\"/s_.*_ <div id=\"lastupdate\" style='font-size:0.7em'>last update $(date)</div>_" ${TEST_PATH}web/test.html ${TEST_PATH}web/monster.html ${TEST_PATH}web/monster-dev.html
sed -i -E "s_src=\"([\"]*)\.js.*\"_src=\"\1.js?r=$(date +"%T")\"_" ${TEST_PATH}web/test.html ${TEST_PATH}web/monster.html ${TEST_PATH}web/monster-dev.html
sed -i -E "s_dist/([0-9]+\.[0-9]+\.[0-9]+)*/dist/monster_dist/${VERSION}/dist/monster_" ${TEST_PATH}web/monster.html ${TEST_PATH}web/monster-dev.html
import {expect} from "chai"; import {expect} from "chai";
import {ConsoleHandler} from "../../../../../application/source/logging/handler/console.mjs"; import {ConsoleHandler} from "../../../../../application/source/logging/handler/console.mjs";
import {LogEntry} from "../../../../../application/source/logging/logentry.mjs"; import {LogEntry} from "../../../../../application/source/logging/logentry.mjs";
import {FATAL} from "../../../../../application/source/logging/logger.mjs"; import {TRACE, WARN, DEBUG, ERROR, FATAL, INFO} from "../../../../../application/source/logging/logger.mjs";
describe('Logging', function () { describe('Logging', function () {
...@@ -12,7 +12,27 @@ describe('Logging', function () { ...@@ -12,7 +12,27 @@ describe('Logging', function () {
}); });
it('should log to console', function () { it('should log to console', function () {
expect(new ConsoleHandler().setAll().log(new LogEntry(FATAL, [1, true, 'message']))).to.be.true; expect(new ConsoleHandler().setAll().log(new LogEntry(FATAL, [1, true, 'fatal']))).to.be.true;
});
it('should log to console', function () {
expect(new ConsoleHandler().setAll().log(new LogEntry(TRACE, [1, true, 'trace']))).to.be.true;
});
it('should log to console', function () {
expect(new ConsoleHandler().setAll().log(new LogEntry(WARN, [1, true, 'warn']))).to.be.true;
});
it('should log to console', function () {
expect(new ConsoleHandler().setAll().log(new LogEntry(DEBUG, [1, true, 'debug']))).to.be.true;
});
it('should log to console', function () {
expect(new ConsoleHandler().setAll().log(new LogEntry(ERROR, [1, true, 'error']))).to.be.true;
});
it('should log to console', function () {
expect(new ConsoleHandler().setAll().log(new LogEntry(INFO, [1, true, 'info']))).to.be.true;
}); });
}); });
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<title>Mocha Monster</title> <title>Mocha Monster</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="mocha.css"/> <link rel="stylesheet" href="mocha.css"/>
<script id="polyfill" <script id="polyfill" src="https://polyfill.io/v3/polyfill.min.js?features=Array.from,Array.isArray,Array.prototype.entries,Array.prototype.fill,Array.prototype.filter,Array.prototype.forEach,Array.prototype.indexOf,Array.prototype.keys,Array.prototype.lastIndexOf,Array.prototype.map,Array.prototype.reduce,Array.prototype.sort,ArrayBuffer,atob,CustomEvent,DataView,document,Document,DocumentFragment,Element,Event,fetch,globalThis,HTMLDocument,HTMLTemplateElement,Intl,JSON,Map,Math.log2,Number.isInteger,Object.assign,Object.defineProperty,Object.entries,Object.freeze,Object.getOwnPropertyDescriptor,Object.getOwnPropertyNames,Object.getPrototypeOf,Object.keys,Promise,Reflect,Reflect.defineProperty,Reflect.get,Reflect.getOwnPropertyDescriptor,Reflect.setPrototypeOf,Set,String.prototype.endsWith,String.prototype.matchAll,String.prototype.padStart,String.prototype.startsWith,String.prototype.trim,Symbol,Symbol.iterator,Uint16Array,Uint8Array,URL,WeakMap,WeakSet"
src="https://polyfill.io/v3/polyfill.min.js?features=Array.from,Array.isArray,Array.prototype.entries,Array.prototype.fill,Array.prototype.forEach,Array.prototype.indexOf,Array.prototype.keys,Array.prototype.lastIndexOf,Array.prototype.map,Array.prototype.reduce,Array.prototype.sort,ArrayBuffer,atob,DataView,document,DocumentFragment,Element,Event,globalThis,HTMLDocument,HTMLTemplateElement,JSON,Map,Math.log2,Number.isInteger,Object.assign,Object.defineProperty,Object.entries,Object.getOwnPropertyDescriptor,Object.getPrototypeOf,Object.keys,Promise,Reflect,Reflect.defineProperty,Reflect.get,Reflect.getOwnPropertyDescriptor,Reflect.setPrototypeOf,Set,String.prototype.endsWith,String.prototype.matchAll,String.prototype.padStart,String.prototype.startsWith,String.prototype.trim,Symbol,Symbol.iterator,WeakMap,WeakSet" src="https://polyfill.io/v3/polyfill.min.js?features=Array.from,Array.isArray,Array.prototype.entries,Array.prototype.fill,Array.prototype.forEach,Array.prototype.indexOf,Array.prototype.keys,Array.prototype.lastIndexOf,Array.prototype.map,Array.prototype.reduce,Array.prototype.sort,ArrayBuffer,atob,DataView,document,DocumentFragment,Element,Event,globalThis,HTMLDocument,HTMLTemplateElement,JSON,Map,Math.log2,Number.isInteger,Object.assign,Object.defineProperty,Object.entries,Object.getOwnPropertyDescriptor,Object.getPrototypeOf,Object.keys,Promise,Reflect,Reflect.defineProperty,Reflect.get,Reflect.getOwnPropertyDescriptor,Reflect.setPrototypeOf,Set,String.prototype.endsWith,String.prototype.matchAll,String.prototype.padStart,String.prototype.startsWith,String.prototype.trim,Symbol,Symbol.iterator,WeakMap,WeakSet"
crossorigin="anonymous" crossorigin="anonymous"
referrerpolicy="no-referrer"></script> referrerpolicy="no-referrer"></script>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</head> </head>
<body> <body>
<div id="headline" style="display: flex;align-items: center;justify-content: center;flex-direction: column;"> <div id="headline" style="display: flex;align-items: center;justify-content: center;flex-direction: column;">
<h1 style='margin-bottom: 0.1em;'>Monster 0.1.8</h1> <h1 style='margin-bottom: 0.1em;'>Monster 2.0.7</h1>
<div id="lastupdate" style='font-size:0.7em'>last update So 7. Aug 19:45:23 CEST 2022</div> <div id="lastupdate" style='font-size:0.7em'>last update So 7. Aug 19:45:23 CEST 2022</div>
</div> </div>
<div id="mocks"></div> <div id="mocks"></div>
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment