##// END OF EJS Templates
readme: updated readme
readme: updated readme

File last commit:

r43:71e75046
r104:349cfd8a
Show More
js_log.jinja2
58 lines | 2.2 KiB | text/plain | TextLexer
js tests: simplify js test html
r43 <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error test</title>
<meta name="description" content="">
{% if request.registry.settings.get('appenlight.public_api_key') %}
<script type="application/javascript">
var initAppEnlight = function () {
if(this.readyState!='loading'){
AppEnlight.init({
apiKey:'{{ request.registry.settings.get('appenlight.public_api_key') }}',
windowOnError: 1 // enable to hook to window.onerror
});
// setting request info is completly optional
AppEnlight.setRequestInfo({
server:"{{ request.environ.get('SERVER_NAME', '<unknown>') }}",
{% if request.user %}
username:'{{ request.user.user_name }}',
{% endif %}
ip: "{{ request.environ.get('REMOTE_ADDR', '') }}",
request_id:"{{ request.environ.get('appenlight.request_id', '') }}"
});
AppEnlight.addGlobalTags({framework:'angular', 'language':'javascript'});
AppEnlight.addGlobalExtra({some_key:'on every request'});
}
};
// load the script asynchroneously
var scrElem = document.createElement('script');
scrElem.type = 'text/javascript';
scrElem.async = true;
scrElem.onload = scrElem.onreadystatechange = initAppEnlight;
scrElem.src = "//cdn.jsdelivr.net/appenlight/latest/appenlight-client.min.js";
scrElem.src = "/static/appenlight/js/appenlight-client.js";
var p = document.getElementsByTagName('script')[0];
p.parentNode.insertBefore(scrElem, p);
</script>
{% endif %}
</head>
<body>
<h1>Error test</h1>
project: initial commit
r0
<script type="text/javascript">
js tests: simplify js test html
r43 setTimeout(function(){
AppEnlight.log('error',"some test message");
AppEnlight.log('info',"some info message");
AppEnlight.log('warning',"some warn message");
},2000);
project: initial commit
r0
</script>
js tests: simplify js test html
r43 </body>
</html>