public class

ErrorLogGenerator

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.client.ErrorLogGenerator

Class Overview

An error log generator.

Summary

Constants
int ERRORLOG_VERSION
String KEY_URLENCODED_THREADS
Public Constructors
ErrorLogGenerator(Throwable t)
Public Methods
String addRecord(String key, Object value)
Add a new record.
String addRecord(String key, Object value, boolean generateNewKeyIfExists)
Add a new record.
String dumpTo(String folder, String filename, boolean encode)
Dump the log to disk.
String dumpTo(String folder)
Dump the unencoded log to a folder on disk.
static String generateUrlencodedThreadsRecordValue()
String getLog(Collection<String> keys, boolean encode)
Generate a string representation of this error log.
String getLog()
Generate an unencoded string representation of this entire error log.
LinkedHashMap<String, String> getRecords()
Throwable getThrowable()
void recordEnginesInformation(IEnginesContext engctx)
boolean removeRecord(String key)
boolean setRecord(String key, Object value)
Add a new or replace an existing record.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int ERRORLOG_VERSION

Constant Value: 2 (0x00000002)

public static final String KEY_URLENCODED_THREADS

Constant Value: "urlencoded-threads"

Public Constructors

public ErrorLogGenerator (Throwable t)

Public Methods

public String addRecord (String key, Object value)

Add a new record. If a record with a similar key exists, a new key will be generated to insert this record without overwriting the pre-existing value.

Parameters
key non-null record key
value record value
Returns
  • the actual key that was used to register the record

public String addRecord (String key, Object value, boolean generateNewKeyIfExists)

Add a new record. If a record with a similar key exists, the existing record will not be replaced. It may be added using a different key, or it may not be added at all.

Parameters
key non-null record key
value record value
Returns
  • the actual key that was used to register the record, or null if the record was not inserted

public String dumpTo (String folder, String filename, boolean encode)

Dump the log to disk.

Parameters
filename optional; if null, will auto-generate a filename (jeb_errorlog_...)
encode true to URL-encode the keys and values

public String dumpTo (String folder)

Dump the unencoded log to a folder on disk.

public static String generateUrlencodedThreadsRecordValue ()

public String getLog (Collection<String> keys, boolean encode)

Generate a string representation of this error log.

Parameters
keys the keys of records to be generated; use null to mean all; if an ordered collection is provided, the order is maintained
encode true to URL-encode the keys and values
Returns
  • the string representation of this log

public String getLog ()

Generate an unencoded string representation of this entire error log.

Returns
  • the string representation of this log

public LinkedHashMap<String, String> getRecords ()

public Throwable getThrowable ()

public void recordEnginesInformation (IEnginesContext engctx)

public boolean removeRecord (String key)

Returns
  • true if the record was removed

public boolean setRecord (String key, Object value)

Add a new or replace an existing record.

Returns
  • true if the key did not exist, false if a record having a same key was replaced

public String toString ()