root/as3/OSCemote/branches/saqoosha/server/flosc-0.3.1/Debug.java

リビジョン 1048, 0.9 kB (コミッタ: uranodai, コミット時期: 4 年 前)

--

Line 
1 import java.util.Calendar;
2
3 public class Debug {
4
5     /**
6      * Writes a message to System.out.println in the format
7      * [mm/dd/yy hh:mm:ss] message.
8      * @param   activity    The message.
9     */
10     public static void writeActivity(String activity) {
11
12         // comment this line to turn on the debug output
13         if (true) return;
14
15         // --- get the current date and time
16         Calendar cal = Calendar.getInstance();
17         activity = "[" + cal.get(Calendar.MONTH)
18                  + "/" + cal.get(Calendar.DAY_OF_MONTH)
19                  + "/" + cal.get(Calendar.YEAR)
20                  + " "
21                  + cal.get(Calendar.HOUR_OF_DAY)
22                  + ":" + cal.get(Calendar.MINUTE)
23                  + ":" + cal.get(Calendar.SECOND)
24                  + "] " + activity + "\n";
25
26         // --- display the activity
27         System.out.print(activity);
28     }
29
30 }
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。