xref: /AOO41X/main/javainstaller2/src/JavaSetup/org/openoffice/setup/Util/LogManager.java (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 package org.openoffice.setup.Util;
29 
30 import java.util.Vector;
31 
32 public class LogManager {
33 
34     static private Vector logfile; /* collects all logging information during installation */
35     static private Vector commandsLogFile;  /* collects all system commands information during installation */
36     static private Vector saveLogFile;  /* contains the content of the saved log file */
37     static private Vector modulesLogFile;
38 
39     private LogManager() {
40     }
41 
42     static public Vector getSaveLogfile() {
43         return saveLogFile;
44     }
45 
46     static public void addLogfileComment(String text) {
47         logfile.add(text);
48     }
49 
50     static public void addCommandsLogfileComment(String text) {
51         commandsLogFile.add(text);
52     }
53 
54     static public void addModulesLogfileComment(String text) {
55         modulesLogFile.add(text);
56     }
57 
58     static public void setCommandsHeaderLine(String text) {
59         String line = "*************************************";
60         commandsLogFile.add("");
61         commandsLogFile.add(line);
62         commandsLogFile.add("<b>" + text + "</b>");
63         commandsLogFile.add(line);
64         commandsLogFile.add("");
65     }
66 
67     static public void setModulesLogFileHeaderLine(String text) {
68         String line = "*************************************";
69         modulesLogFile.add(line);
70         modulesLogFile.add(text);
71         modulesLogFile.add(line);
72     }
73 
74     static public String publishLogfileContent(String text, String separatorline) {
75         for (int i = 0; i < logfile.size(); i++) {
76             text = text + logfile.get(i) + "<br>";
77         }
78 
79         if ( ! logfile.isEmpty() ) {
80             text = text + separatorline + "<br>";
81         }
82 
83         return text;
84     }
85 
86     static public String publishCommandsLogfileContent(String text) {
87         for (int i = 0; i < commandsLogFile.size(); i++) {
88             text = text + commandsLogFile.get(i) + "<br>";
89         }
90 
91         return text;
92     }
93 
94     static public Vector getModulesLogFile() {
95         return modulesLogFile;
96     }
97 
98     static {
99         logfile = new Vector();
100         commandsLogFile = new Vector();
101         saveLogFile = new Vector();
102         modulesLogFile = new Vector();
103     }
104 
105 }
106