29.07.2013 Views

Master of Science thesis Fighting Spam

Master of Science thesis Fighting Spam

Master of Science thesis Fighting Spam

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

10.5.4 Debugger<br />

package <strong>Spam</strong>Cash.Utilities;<br />

import java.io.*;<br />

import java.util.StringTokenizer;<br />

public class Debugger<br />

{<br />

//Used to print extra information in the money-status window<br />

public final static boolean debugging = false;<br />

/**<br />

* Debugging is done using the following level definitions<br />

* Levels for classlevels overrides package levels !<br />

*<br />

* Level 0: No output is generated<br />

*<br />

* Level 1: Information about behavior under normal operation is shown.<br />

* Fatal exceptions is shown as well<br />

*<br />

* Level 2: Level 1 AND Information about behavior in general is shown<br />

* All Exceptions and error situations is shown<br />

*<br />

* Level 3: Level 2 AND information about the state <strong>of</strong> the class is shown<br />

* everytime an event/call happens.<br />

*/<br />

private static String runningAplication;<br />

private final static int globalDebugLevel = 3;<br />

private final static boolean printLevel1 = true;<br />

private final static boolean printLevel2 = true;<br />

private final static boolean printLevel3 = true;<br />

private final static boolean printExceptions = true;<br />

private final static boolean printExceptionStacktrace = true;<br />

private final static boolean trim = false;<br />

private final static DebugDefinition[] debugDefinitions = new<br />

DebugDefinition[]<br />

{<br />

new DebugDefinition("<strong>Spam</strong>Cash", 0),<br />

new DebugDefinition("Servers", 1),<br />

new DebugDefinition("Utilities", 0),<br />

new DebugDefinition("GUI", 0),<br />

new DebugDefinition("Control", 1),<br />

new DebugDefinition("IncomingMailProcessor", 1),<br />

new DebugDefinition("OutgoingMailProcessor", 1),<br />

new DebugDefinition("PackageQueue", 0),<br />

new DebugDefinition("IMAPProxy:NonBlokingProxyConnection", 0),<br />

new DebugDefinition("SMTPProxy:NonBlokingProxyConnection", 0),<br />

new DebugDefinition("AbstractMailProxy", 0),<br />

new DebugDefinition("AbstractNonBlockingMailProxy", 0),<br />

new DebugDefinition("IMAPProxy", 1),<br />

new DebugDefinition("SMTPProxy", 1),<br />

new DebugDefinition("POP3Proxy", 1),<br />

new DebugDefinition("session", 0),<br />

new DebugDefinition("Cryptotools", 0),<br />

new DebugDefinition("FileHandler", 0),<br />

new DebugDefinition("Currency", 0),<br />

new DebugDefinition("MimeTools", 0),<br />

new DebugDefinition("SafeHandler", 1),<br />

new DebugDefinition("Safe", 0)};<br />

private static boolean print = true;<br />

public static void setApplicationName(String name)<br />

{<br />

runningAplication = name;<br />

File f = new File(Config.logFolderPath);<br />

400

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!