Cross Reference: /yui3/src/console/tests/basic.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
f2d82649d9c0b6371cffaff1528277f9db7f0961Luke Smith<!doctype html>
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith<html>
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith<head>
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith <title>Test Page</title>
830942dd35b8923359649312679641a5de751291Luke Smith <link type="text/css" rel="stylesheet" href="/build/console/assets/skins/sam/console-filters.css">
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith <style type="text/css">
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith#c {
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith margin-bottom: 1em;
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith}
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith </style>
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith</head>
8e66dcad24a2cc4d23e84ee786f0ccacee1f2aadLuke Smith<body class="yui3-skin-sam">
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith<div class="markup">
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith <div id="c"></div>
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith <input type="button" id="foo" value="Log foo msg">
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith <input type="button" id="info" value="Log info msg">
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith <input type="button" id="warn" value="Log warn msg">
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith <input type="button" id="error" value="Log error msg">
ed51daad3a3ab15255ca10edef69d5f703d69adbLuke Smith <button type="button" id="hide">Hide</button>
ed51daad3a3ab15255ca10edef69d5f703d69adbLuke Smith <button type="button" id="show">Show</button>
ed51daad3a3ab15255ca10edef69d5f703d69adbLuke Smith <button type="button" id="collapse">Collapse</button>
ed51daad3a3ab15255ca10edef69d5f703d69adbLuke Smith <button type="button" id="expand">Expand</button>
16479f9c396537f36d0d9c5633b24df618eee1e6Luke Smith <button type="button" id="destroy">Destroy</button>
c31ae0e3c3d2726907b1876b5fe81cfd94527d5dLuke Smith <button type="button" id="throttle">Throttle</button>
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith <button type="button" id="limit">Limit cache</button>
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith</div>
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith<script type="text/javascript" src="/build/yui/yui.js"></script>
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith<script type="text/javascript">
f2d82649d9c0b6371cffaff1528277f9db7f0961Luke SmithYUI({
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith //useBrowserConsole:false,
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith //logLevel: 'warn',
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith //filter: 'debug',
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith //logInclude : { global: true },
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith //logExclude : { attribute: true },
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith filters : {
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith console: 'raw',
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith 'console-filters': 'debug'
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith },
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith base: '/build/'
ccd67bca87e30bb4eb9be54305324ecb78fc66d9Luke Smith}).use('console','console-filters', function (Y) {
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smithvar x = {
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith foo : 0,
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith info : 0,
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith warn : 0,
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith error : 0
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith};
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke SmithY.on('click',function (e) { Y.log('FOO message '+(++x.foo),'foo'); },'#foo');
3702e9bc9b6b94b58c66f0cf1316bdda55419744Luke SmithY.on('click',function (e) { Y.log('INFO message long message that should trigger scroll bars '+(++x.info)); },'#info');
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke SmithY.on('click',function (e) { Y.log('WARN message '+(++x.warn),'warn'); },'#warn');
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke SmithY.on('click',function (e) { Y.log('ERROR message '+(++x.error),'error'); },'#error');
f7d3e3fb495841c8817829617d461a6bca039fa3Luke SmithY.one('#hide').on('click', function () { yconsole.hide(); });
f7d3e3fb495841c8817829617d461a6bca039fa3Luke SmithY.one('#show').on('click', function () { yconsole.show(); });
f7d3e3fb495841c8817829617d461a6bca039fa3Luke SmithY.one('#collapse').on('click', function () { yconsole.collapse(); });
f7d3e3fb495841c8817829617d461a6bca039fa3Luke SmithY.one('#expand').on('click', function () { yconsole.expand(); });
f7d3e3fb495841c8817829617d461a6bca039fa3Luke SmithY.one('#destroy').on('click', function () { yconsole.destroy(); });
f7d3e3fb495841c8817829617d461a6bca039fa3Luke SmithY.one('#throttle').on('click', function () {
c31ae0e3c3d2726907b1876b5fe81cfd94527d5dLuke Smith for (var i = 0; i < 500; ++i) {
c31ae0e3c3d2726907b1876b5fe81cfd94527d5dLuke Smith Y.log('Throttle message ' + i);
c31ae0e3c3d2726907b1876b5fe81cfd94527d5dLuke Smith }
c31ae0e3c3d2726907b1876b5fe81cfd94527d5dLuke Smith});
f7d3e3fb495841c8817829617d461a6bca039fa3Luke SmithY.one('#limit').on('click', function () {
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith yconsole.filter.set('cacheLimit', 500);
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith});
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smithvar yconsole = new Y.Console({
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith //useBrowserConsole: true,
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith //verbose : true,
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith //consoleLimit : 10,
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith boundingBox: '#c',
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith //style : 'inline',
8652e2d20f8ea9c9bfe21217ba427cf0d85ada9aLuke Smith logLevel : "Garbage",
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith newestOnTop : false
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith});
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith//yconsole.plug(Y.Plugin.ConsoleFilters);
ccd67bca87e30bb4eb9be54305324ecb78fc66d9Luke Smith
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smithyconsole.render();
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith//Y.log('testing');
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith//Y.log('testing known category','info');
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke SmithY.log('Using a custom source and category','note','my-app');
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke SmithY.log('Standard info message');
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke SmithY.log('This is a warning','warn','attribute');
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke SmithY.log('This is an error','error','event');
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith//Y.log('testing known source','info','global');
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith//Y.log('testing new source','info','bar');
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith//yconsole.log("Test from the console object",'info','Console');
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith//Y.log('testing warn','warn');
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith//Y.log('testing long warn that will take up multiple lines in the console','warn');
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith//Y.log('testing error','error');
f9918f6b658319940d633dd8c9a2c16d05b4c881Luke Smith//Y.log('testing long error that will take up multiple lines in the console','error');
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith});
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith</script>
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith</body>
dffa577a92ada48777e8e79f5d38dff47cb150c4Luke Smith</html>