-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.html
55 lines (46 loc) · 1.54 KB
/
example.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>PRHONE Log</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto">
<style>
body { margin: 20px; font-family: Roboto, sans-serif; font-size: 2rem; line-height: 1.5; color: #444; background-color: #fefefe; }
h1 { margin: 0; }
</style>
</head>
<body>
<h1>PRHONE Log</h1>
<p>Example of use.</p>
<p>More info at <a href="https://www.npmjs.com/package/prhone-log" target="_blank">npmjs.org/package/prhone-log</a>.</p>
<script src="./lib/index.js"></script>
<script>
(function () {
var Log = window.prhone.Log;
Log.addLevel({
name: 'awesome',
priority: 2,
color: Log.COLORS.MAGENTA
});
var log1 = new Log('myapp1');
var log2 = new Log('myapp2', {
displayTime: false,
priority: 1,
});
log1.debug('message', 1);
log1.info('message', 2);
log1.warn('message', 3);
log1.error('message', 4);
log1.awesome('message', 5);
log2.debug('message', 1);
log2.info('message', 2, { name: 'second', type: 'information' });
log2.warn('message', 3);
log2.error('message', 4);
log2.awesome('message', 5);
console.log(log2.getHistory());
})();
</script>
</body>
</html>