001: /*
002: * Created on 17.05.2005 for PIROL
003: *
004: * SVN header information:
005: * $Author: javamap $
006: * $Rev: 856 $
007: * $Date: 2007-06-18 21:15:27 -0700 (Mon, 18 Jun 2007) $
008: * $Id: PersonalLogger.java 856 2007-06-19 04:15:27Z javamap $
009: */
010: package de.fho.jump.pirol.utilities.debugOutput;
011:
012: import java.io.PrintStream;
013:
014: /**
015: * Class to post personalized debug statements. Holds user information
016: * and uses the GenericDebugLogger itself.
017: *
018: * @author Ole Rahn
019: * @author FH Osnabrück - University of Applied Sciences Osnabrück,
020: * Project: PIROL (2005),
021: * Subproject: Daten- und Wissensmanagement
022: * @see GenericDebugLogger
023: * @see DebugUserIds
024: */
025: public class PersonalLogger {
026:
027: protected String userId = null;
028:
029: protected GenericDebugLogger genericLogger = GenericDebugLogger
030: .getInstance();
031:
032: /**
033: * Constructor
034: * @param userName - should be taken from class DebugUserIds (in this package)
035: */
036: public PersonalLogger(DebugId user) {
037: this .userId = user.getUserName();
038: }
039:
040: /**
041: *
042: * @param message message to print
043: */
044: public final void printDebug(String message) {
045: genericLogger.printDebug(this .userId, message);
046: }
047:
048: /**
049: *
050: * @param message message to print
051: */
052: public final void printError(String message) {
053: genericLogger.printError(this .userId, message);
054: }
055:
056: /**
057: *
058: * @param message message to print
059: */
060: public final void printMinorError(String message) {
061: genericLogger.printMinorError(this .userId, message);
062: }
063:
064: /**
065: *
066: * @param message message to print
067: */
068: public final void printSevereError(String message) {
069: genericLogger.printSevereError(this .userId, message);
070: }
071:
072: /**
073: *
074: * @param message message to print
075: */
076: public final void printWarning(String message) {
077: genericLogger.printWarning(this .userId, message);
078: }
079:
080: /**
081: *
082: *@param message message to print
083: *@param isActive is this statement active? (message won't be printed, if not)
084: */
085: public final void printDebug(String message, boolean isActive) {
086: if (isActive)
087: genericLogger.printDebug(this .userId, message);
088: }
089:
090: /**
091: *
092: *@param message message to print
093: *@param isActive is this statement active? (message won't be printed, if not)
094: */
095: public final void printError(String message, boolean isActive) {
096: if (isActive)
097: genericLogger.printError(this .userId, message);
098: }
099:
100: /**
101: *
102: *@param message message to print
103: *@param isActive is this statement active? (message won't be printed, if not)
104: */
105: public final void printMinorError(String message, boolean isActive) {
106: if (isActive)
107: genericLogger.printMinorError(this .userId, message);
108: }
109:
110: /**
111: *
112: *@param message message to print
113: *@param isActive is this statement active? (message won't be printed, if not)
114: */
115: public final void printSevereError(String message, boolean isActive) {
116: if (isActive)
117: genericLogger.printSevereError(this .userId, message);
118: }
119:
120: /**
121: *
122: *@param message message to print
123: *@param isActive is this statement active? (message won't be printed, if not)
124: */
125: public final void printWarning(String message, boolean isActive) {
126: if (isActive)
127: genericLogger.printWarning(this .userId, message);
128: }
129:
130: /**
131: *
132: * @return true or false //TODO specify the return value
133: */
134: public final boolean isPrintFileAndLine() {
135: return genericLogger.isPrintFileAndLine();
136: }
137:
138: /**
139: *
140: * @return true or false //TODO specify the return value
141: */
142: public final boolean isPrintNewLineFirst() {
143: return genericLogger.isPrintNewLineFirst();
144: }
145:
146: /**
147: *
148: * @return true or false //TODO specify the return value
149: */
150: public final boolean isPrintTimeStamp() {
151: return genericLogger.isPrintTimeStamp();
152: }
153:
154: /**
155: *
156: * @param logLevel
157: */
158: public final void setLogLevel(int logLevel) {
159: genericLogger.setLogLevel(logLevel);
160: }
161:
162: /**
163: *
164: * @param out
165: */
166: public final void setOutputStream(PrintStream out) {
167: genericLogger.setOutputStream(out);
168: }
169: }
|