Mercurial > hg > Applications > TreeVNC
changeset 261:233c73b5b964
add option about set log file name.
author | oc |
---|---|
date | Sun, 07 Dec 2014 11:38:40 +0900 |
parents | 847f2ed2a757 |
children | 7d8f45cadd89 |
files | log/log.txt src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java |
diffstat | 2 files changed, 29 insertions(+), 96 deletions(-) [+] |
line wrap: on
line diff
--- a/log/log.txt Tue Dec 02 17:52:52 2014 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -Interfaces :en1 -Interfaces :en1 -Interfaces :en0 -Interfaces :en0 -Interfaces :en0 -Interfaces :en0 -accept port = 5950 -VNCNetworkInterface :lo0 -1417504767723 : size : 2073600 -1417504767909 : size : 1600 -1417504767964 : size : 1608 -1417504768063 : size : 1024000 -1417504768330 : size : 4278 -1417504768349 : size : 17391 -1417504768413 : size : 777064 -1417504768467 : size : 34424 -1417504768492 : size : 5544 -1417504768509 : size : 6784 -1417504768525 : size : 209 -1417504768552 : size : 3264 -1417504768565 : size : 9464 -1417504768608 : size : 508200 -1417504768659 : size : 841 -1417504768665 : size : 26928 -1417504768716 : size : 508200 -1417504768750 : size : 841 -1417504768770 : size : 26928 -1417504768788 : size : 423330 -1417504768816 : size : 3502 -1417504768823 : size : 79647 -1417504768843 : size : 1444 -1417504768886 : size : 5544 -1417504768914 : size : 4158 -1417504768935 : size : 841 -1417504768944 : size : 57216 -1417504768982 : size : 508200 -1417504769023 : size : 209 -1417504769039 : size : 5138 -1417504769058 : size : 57216 -1417504769064 : size : 26928 -1417504769126 : size : 3264 -1417504769383 : size : 9464 -1417504769539 : size : 1566 -1417504769583 : size : 209 -1417504769604 : size : 26928 -1417504769635 : size : 2291 -1417504769652 : size : 841 -1417504769671 : size : 26928 -1417504769687 : size : 841 -1417504769705 : size : 26928 -1417504769721 : size : 841 -1417504769738 : size : 841 -1417504769756 : size : 26928 -1417504769772 : size : 841 -1417504769786 : size : 4158 -1417504769850 : size : 841 -1417504769885 : size : 209 -1417504770022 : size : 3264 -1417504770105 : size : 9464 -1417504770222 : size : 841 -1417504770228 : size : 148004 -1417504770256 : size : 46080 -1417504770274 : size : 68728 -1417504770293 : size : 46080 -1417504770314 : size : 174760 -1417504770343 : size : 46080 -1417504770361 : size : 41310 -1417504770379 : size : 61740 -1417504770402 : size : 61740 -1417504770436 : size : 36850 -1417504770459 : size : 660 -1417504770463 : size : 9180 -1417504770477 : size : 81224 -1417504770521 : size : 4278 -1417504770571 : size : 200 -1417504770623 : size : 46080 -1417504770670 : size : 480 -1417504770706 : size : 92928 -1417504770721 : size : 10300 -1417504770771 : size : 4140 -1417504770820 : size : 3090 -1417504770871 : size : 5547 -1417504770900 : size : 573792 -1417504770982 : size : 68728 -1417504771025 : size : 140892 -1417504771083 : size : 29808 -1417504771130 : size : 29808 -1417504771153 : size : 4158 -1417504771171 : size : 173400 -1417504771214 : size : 46080 -1417504771232 : size : 14040 -1417504771252 : size : 41310
--- a/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java Tue Dec 02 17:52:52 2014 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java Sun Dec 07 11:38:40 2014 +0900 @@ -14,23 +14,31 @@ private int fixingSizeWidth; private int fixingSizeHeight; private String hostName = null; + private String logFileName = null; private boolean noConnection = false; private boolean permitChangeScreen = true; private boolean showTree = false; private boolean checkDelay = false; private boolean addSerialNum = false; private boolean fixingSizeDisplay = false; + private boolean logFile; - public static void main(String[] args) throws FileNotFoundException { - PrintStream out = new PrintStream("log/log.txt"); - System.setOut(out); - + public static void main(String[] args) { new TreeViewer().vncStart(args); } private void vncStart(String[] args) { modeSelect(args); + if(logFile) { + PrintStream out = null; + try { + out = new PrintStream(logFileName + ".txt"); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } + System.setOut(out); + } if (treeProxy && !viewer) { // start treeManager only ( -p flag ) VncProxyService vps = new VncProxyService(); @@ -114,6 +122,23 @@ } else if ("--addSerialNum".equals(args[i])) { // add data serial number. addSerialNum = true; + } else if ("--logFile".equals(args[i])) { + // add log file. + logFile = true; + try { + this.logFileName = args[++i]; + } catch (ArrayIndexOutOfBoundsException e) { + System.out.println("Please put the log file name. If you do not put file name, set file name logFile.txt"); + } + if (logFileName == null) { + logFileName = "logFile"; + } else if ("-".equals(logFileName.substring(0,1))) { + System.out.println("Please put the log file name. If you do not put file name, set file name logFile.txt"); + logFileName = "logFile"; + i++; + } else { + i++; + } } else { System.out.println("(default) TreeVNCClient\n" + "-v or -c: View shared screen.\n"