org.kth.dks.util
Class DKSPrint

java.lang.Object
  extended by org.kth.dks.util.DKSPrint

public class DKSPrint
extends java.lang.Object


Constructor Summary
DKSPrint()
           
 
Method Summary
static void disableType(DKSPrintTypes type)
          Disables logging for a group of log messages defined by the string argument.
static void enableType(DKSPrintTypes type)
          Enables logging for a group of log messages defined by the string argument.
static java.io.Serializable getDebugInfo()
          Get debug information.
static void logLevel(int level)
          Sets the logging level, 0 for no logging, 1 for printing of debug info that has been explicitly enabled, 2 for every thing, including XML dumps
static java.lang.String prettyPrint(java.lang.String str)
          Cuts the string if it is longer than MAXLEN=75 characters long
static void print(DKSPrintTypes type, byte data)
          like Print with additional line feed
static void print(DKSPrintTypes type, char data)
          like Print with additional line feed
static void print(DKSPrintTypes type, java.lang.String data)
          Prints the data string, if the type of loginfo is enabled for printing.
static void println_noType(DKSPrintTypes type, java.lang.String data)
          like Print with additional line feed.
static void println(DKSPrintTypes type, java.lang.String data)
          like Print with additional line feed.
static void printXML(byte[] arr, boolean sending)
          Prints a marshalled XML message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DKSPrint

public DKSPrint()
Method Detail

logLevel

public static void logLevel(int level)
Sets the logging level, 0 for no logging, 1 for printing of debug info that has been explicitly enabled, 2 for every thing, including XML dumps

Parameters:
level - int

enableType

public static void enableType(DKSPrintTypes type)
Enables logging for a group of log messages defined by the string argument.

Parameters:
type - the identfifier for the group of log info

disableType

public static void disableType(DKSPrintTypes type)
Disables logging for a group of log messages defined by the string argument.

Parameters:
type - the identfifier for the group of log info

print

public static void print(DKSPrintTypes type,
                         java.lang.String data)
Prints the data string, if the type of loginfo is enabled for printing. The type is not automatically displayed.

Parameters:
type - type of loginfo
data - String to be printed

println

public static void println(DKSPrintTypes type,
                           java.lang.String data)
like Print with additional line feed. Moreover, the type of loginfo is attached the output.

Parameters:
type - type of loginfo
data - String to be printed

println_noType

public static void println_noType(DKSPrintTypes type,
                                  java.lang.String data)
like Print with additional line feed.

Parameters:
data - String to be printed

print

public static void print(DKSPrintTypes type,
                         char data)
like Print with additional line feed

Parameters:
data - char to be printed

print

public static void print(DKSPrintTypes type,
                         byte data)
like Print with additional line feed

Parameters:
byte - char to be printed

printXML

public static void printXML(byte[] arr,
                            boolean sending)
Prints a marshalled XML message

Parameters:
arr - byte[] is the byte array to print
sending - boolean indicates whether the messages is to be sent or received

prettyPrint

public static java.lang.String prettyPrint(java.lang.String str)
Cuts the string if it is longer than MAXLEN=75 characters long

Parameters:
str - is the string to be pretty printed
Returns:
String

getDebugInfo

public static java.io.Serializable getDebugInfo()
Get debug information.

Returns:
Serializable The object containing debug info.


Copyright © 2010. All Rights Reserved.