Project

General

Profile

log4javascript_diff_1.txt

Sergey Ivanovskiy, 08/25/2015 04:08 PM

Download (3.46 KB)

 
1
=== modified file 'src/com/goldencode/p2j/ui/client/driver/web/index.html'
2
--- src/com/goldencode/p2j/ui/client/driver/web/index.html	2015-08-20 14:39:49 +0000
3
+++ src/com/goldencode/p2j/ui/client/driver/web/index.html	2015-08-25 19:25:45 +0000
4
@@ -2,8 +2,32 @@
5
 <html>
6
    <head>                                                                   
7
       <title>P2J ${client_title} Web Client</title>
8
-      
9
-      <link rel="stylesheet" type="text/css" href="/dojo-toolkit/dijit/themes/claro/claro.css">
10
+      <style type="text/css">
11
+      .console {
12
+         position: fixed;
13
+         overflow: hidden;
14
+         top :  10px;
15
+         right :  10px;
16
+         width   : 50%;
17
+         height  : 90%;
18
+         padding : 10px;
19
+         border  : 2px solid #999999;
20
+         background : #eeeeee;
21
+         margin  : 10px 20px 10px 20px;
22
+      }
23
+      </style>
24
+
25
+      <script>
26
+         var dojoConfig = {
27
+                     async: true,
28
+                     baseUrl: "./",
29
+                     packages: [{ name : "common", location : "./common" },
30
+                                { name : "client", location: "./client" },
31
+                                { name : "dojo", location: "./dojo-toolkit/dojo" }]
32
+                 };
33
+      </script>
34
+
35
+<link rel="stylesheet" type="text/css" href="/dojo-toolkit/dijit/themes/claro/claro.css">
36
       <!-- load dojo -->      
37
       <script src="/dojo-toolkit/dojo/dojo.js" data-dojo-config="async: true"></script>  
38
             
39
@@ -19,11 +43,15 @@
40
       <script type="text/javascript" src="/common/p2j.fonts.js"></script>
41
       
42
       <script>
43
-      require(["dojo"], function(dojo)
44
+      require(["dojo/ready", "common/log4javascript"], function(ready, log4javascript)
45
       {
46
-         dojo.ready(function()
47
+         ready(function()
48
          {   
49
             "use strict";
50
+            p2j.logger = log4javascript.getLogger();
51
+            var inPageAppender = new log4javascript.InPageAppender("p2j.console", false, false, true, "100%", "100%");
52
+            p2j.logger.addAppender(inPageAppender);
53
+            p2j.logger.setLevel(log4javascript.Level.ALL);
54
             p2j.init({
55
                'isGui' : ${isGui},
56
                'canvas' : {'size' : {'${height_name}' : ${height_val}, '${width_name}' : ${width_val}}, 'mouse' : false},
57
@@ -57,5 +85,6 @@
58
       <form name="form" action="javascript:void(0);" method="post">
59
          <input type="text" name="copy" id="copy" value="" style="opacity:0;position:fixed;top:0px;left:0px;margin-left:-200px"/>
60
       </form>
61
+      <div id="p2j.console" class="console"/>
62
    </body>
63
 </html>
64

    
65
=== modified file 'src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.screen.js'
66
--- src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.screen.js	2015-08-24 18:49:40 +0000
67
+++ src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.screen.js	2015-08-25 19:30:33 +0000
68
@@ -711,7 +711,7 @@
69
    {
70
       var numOps = p2j.socket.readInt32BinaryMessage(message, 5);
71
                                    
72
-      console.log("START DRAWING CYCLE");
73
+      p2j.logger.debug("START DRAWING CYCLE");
74
       
75
       var idx = 9;
76
       
77
@@ -1113,12 +1113,12 @@
78
                break drawLoop;
79
          }
80
          
81
-         console.log("PaintPrimitives.%s %s\n", ops[type], extra);
82
+         p2j.logger.debug("PaintPrimitives." + ops[type] + " " + extra);
83
          
84
          idx += sz;
85
       }
86
       
87
-      console.log("END DRAWING CYCLE");
88
+      p2j.logger.debug("END DRAWING CYCLE");
89
    }; 
90
    
91
    /**
92