Source code: org/alicebot/server/core/responder/ResponderXMLLogger.java
1 // Decompiled by Jad v1.5.8c. Copyright 2001 Pavel Kouznetsov.
2 // Jad home page: http://www.geocities.com/kpdus/jad.html
3 // Decompiler options: packimports(3)
4
5 package org.alicebot.server.core.responder;
6
7 import java.text.SimpleDateFormat;
8 import java.util.Date;
9 import org.alicebot.server.core.*;
10 import org.alicebot.server.core.logging.XMLLog;
11 import org.alicebot.server.core.util.Toolkit;
12
13 public class ResponderXMLLogger
14 {
15
16 public ResponderXMLLogger()
17 {
18 }
19
20 public static void log(String s, String s1, String s2, String s3, String s4)
21 {
22 String s5 = PredicateMaster.get(Globals.getClientNamePredicate(), s3, s4);
23 XMLLog.log(" <exchange>" + LINE_SEPARATOR + " " + " " + "<timestamp>" + (new SimpleDateFormat(TIMESTAMP_LOG_FORMAT)).format(new Date()).trim() + "</timestamp>" + LINE_SEPARATOR + " " + " " + "<userid>" + s3 + "</userid>" + LINE_SEPARATOR + " " + " " + "<clientname>" + s5 + "</clientname>" + LINE_SEPARATOR + " " + " " + "<botid>" + s4 + "</botid>" + LINE_SEPARATOR + " " + " " + "<input>" + Toolkit.escapeXMLChars(s) + "</input>" + LINE_SEPARATOR + " " + " " + "<response>" + s1 + "</response>" + LINE_SEPARATOR + " " + "</exchange>" + LINE_SEPARATOR, Bots.getBot(s4).getChatlogSpec());
24 }
25
26 private static final String TIMESTAMP_LOG_FORMAT = Globals.getProperty("programd.logging.timestamp-format", "yyyy-MM-dd H:mm:ss");
27 private static final String EXCHANGE_START = "<exchange>";
28 private static final String TIMESTAMP_START = "<timestamp>";
29 private static final String TIMESTAMP_END = "</timestamp>";
30 private static final String USERID_START = "<userid>";
31 private static final String USERID_END = "</userid>";
32 private static final String CLIENTNAME_START = "<clientname>";
33 private static final String CLIENTNAME_END = "</clientname>";
34 private static final String BOTID_START = "<botid>";
35 private static final String BOTID_END = "</botid>";
36 private static final String INPUT_START = "<input>";
37 private static final String INPUT_END = "</input>";
38 private static final String RESPONSE_START = "<response>";
39 private static final String RESPONSE_END = "</response>";
40 private static final String EXCHANGE_END = "</exchange>";
41 private static final String LINE_SEPARATOR = System.getProperty("line.separator", "\n");
42 private static final String INDENT = " ";
43
44 }