-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmonitorTest.html
171 lines (160 loc) · 5.38 KB
/
monitorTest.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<!DOCTYPE HTML>
<html>
<head>
<title></title>
<link href="http://code.jquery.com/ui/1.8.21/themes/base/jquery-ui.css" type="text/css" rel="stylesheet">
<!--script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script
<script type="text/javascript" src="http://style.china.alibaba.com/fdevlib/js/fdev-v4/core/fdev-min.js"></script>-->
<!--script type="text/javascript" src="http://style.china.alibaba.com/js/lib/fdev-v4/core/fdev-min.js"></script-->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.8.21/jquery-ui.min.js"></script>
<script type="text/javascript" src="logging.js"></script>
<!--script type="text/javascript" src="monitor.js"></script-->
<style type="text/css">
.cirBorder{
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius:6px;
}
.fl{
float: left;
}
.fr{
float:right;
}
.fbold{
font-weight:bold;
}
.line-through{
text-decoration: line-through;
}
ul li{
list-style-type: none;
width:1024px;
display:block;
clear:both;
}
.container{
width:100%;
clear: both;
}
.comp-monitor-stack{
border: solid 1px black;
width: 400px;
font-size: 14px;
color:#2b2b2b;
line-height: 21px;
font-weight: normal;
padding: 10px 0px;
height:auto;
background-color:#FFF;
margin:10px 50px;
}
.comp-monitor-stack ul li{
border-bottom: dashed 1px black;
width:380px;
}
.comp-monitor-stack .header{
font-size:20px;
background-color:black;
color:white;
height:21px;
padding-left:8px;
}
.comp-monitor-stack .content{
padding:0px 8px;
}
.screenShotContainer{
clear:both;
}
.screenShotContainer img{
width:300px;
height:200px;
margin:8px;
}
</style>
</head>
<body>
<ul>
<li>
<div class="cirBorder comp-monitor-stack fl">
<h2 class="header"> <span class="line-through">what's</span> this?</h2>
<p class="content">this is the web application log monitor test, you just press <span class="fbold">ctrl+alt+l (log) </span> quick key to start the log, you could try it right now.</p>
</div>
</li>
<li>
<div class="cirBorder comp-monitor-stack fl">
<h2 class="header"> <span class="line-through">what's</span> problem it want to solve?</h2>
<ul class="content">
<li>1: IE lower version do not have some console method, like console.error, which high version browser have, so if use this in our code, it will case script error under lower IE version </li>
<li>2: log level control, log filter etc, during the development, we could open the log functionality, before publish the project, we could disalbe the log feature.</li>
<li>3: this is the very impress feature, we could see the log , even under IE6. how? see how stack :)-</li>
</ul>
</div>
</div>
</li>
<li>
<div class="cirBorder comp-monitor-stack fl">
<h2 class="header"><span class="line-through"> How</span> to run?</h2>
<p class="content"> You just press <span class="fbold"> ctrl+alt+l (log) </span>quick key, to launch log monitor</p>
</div>
</li>
<li>
<div class="screenShotContainer comp-monitor-stack cirBorder fl">
<h2 class="header"><span class="line-through">How </span> does it looks like:</h2>
<img src="imgs/ie6.png" />
</div>
</li>
<script type="text/javascript">
/**
* Author: zhouquan.yezq
* time: 4/8/2012
*/
jQuery(document).ready(function($) {
var mylog=$.Logger("logger-monitor-tester");
$.Logger.setLogLevel(4); // logger-monitor-tester
$.Logger.setLogFilter(/^.*monitor.*$/,function(msg,url, time){
//todo
});
//$.setLogLevel(-1);
//var mylog2=$.Logger("logger-monitor-tester22");
mylog.log("+++log test start+++");
//mylog2.log("+++log22 test start+++");
$(document).keydown(function(e) {
if (e.ctrlKey && e.altKey && e.keyCode == 76) { //ctrl+alt+l
mylog.log("log start++=");
int=self.setInterval(function() {
var logType=$.now().toString().slice(-1);
try{
switch (logType)
{
case '1':
mylog.info("####"+$.now()+":"+$.now()+"####");
break;
case '2':
mylog.warn("####"+$.now()+":"+$.now()+"####");
break;
case '3':
mylog.debug("####"+$.now()+":"+$.now()+"####");
break;
case '4':
mylog.error("####"+$.now()+":"+$.now()+"####");
break;
default:
mylog.log("####"+$.now()+":"+$.now()+"####");
}
//throw new Error('this is the my code error'+$.now());
//throw new SyntaxError( "SyntaxError! ");
}catch(ex){
mylog.printWrapError(ex);
}
},500);
}
if (e.altKey && e.keyCode == 68) { //ctrl+d
int=window.clearInterval(int);
}
});
});
</script>
</body>
</html>