Public Member Functions | |
Logger (String categoryName) | |
Creates a new Logger instance. | |
Static Package Functions | |
[static initializer] | |
Create static context and loads logger.proprties configuration file. | |
Print and Output Routines | |
| |
synchronized void | println (String text) |
Prints a log message. | |
synchronized void | println (String text, int val1) |
Prints a log message including 1 integer parameter. | |
synchronized void | println (String text, int val1, int val2) |
Prints a log message including 2 integer parameters. | |
synchronized void | println (String text, int val1, int val2, int val3) |
Prints a log message including 3 integer parameters. | |
synchronized void | println (String text, int val1, int val2, int val3, int val4) |
Prints a log message including 4 integer parameters. | |
synchronized void | printHexDump (byte[] dataArr, int ofs, int len) |
Prints an array of bytes in hexadecimal notation. | |
synchronized void | printAsciiDump (byte[] dataArr, int ofs, int len) |
Interprets the data bytes as ASCII characters and outStream.prints them. | |
Logger Configuration | |
| |
static synchronized void | loggerEnable () |
Enables logging to stdout. | |
static synchronized void | loggerDisable () |
Disbles logging. | |
static synchronized void | categoryEnable (String categoryName) |
Enabled log outputs for this category. | |
static synchronized void | categoryDisable (String categoryName) |
Disables log outputs for this category. |
Logger class.
Used for debugging and performance analysis.
Logging can be enabled and configured via an optional logger.properties file and programmatically during run-time. The logger.properties is searched in the current directory.
Sample logger.properties file:
# # Logger configuration file # # Set to true to enable logging in principle logger.enable=true # Exception category logger.category.EXCP=true # Function category logger.category.FUNC=true # Send category logger.category.SEND=true # Receive category logger.category.RECV=true
Logger | ( | String | categoryName | ) |
Creates a new Logger
instance.
categoryName | A log category name (typically 4 letters) |
static synchronized void categoryEnable | ( | String | categoryName | ) | [static] |
Enabled log outputs for this category.
categoryName | The log category name |
static synchronized void categoryDisable | ( | String | categoryName | ) | [static] |
Disables log outputs for this category.
categoryName | The log category name |
synchronized void println | ( | String | text | ) |
Prints a log message.
text | Log text |
synchronized void println | ( | String | text, | |
int | val1 | |||
) |
Prints a log message including 1 integer parameter.
text | Log text | |
val1 | Integer value |
synchronized void println | ( | String | text, | |
int | val1, | |||
int | val2 | |||
) |
Prints a log message including 2 integer parameters.
text | Log text | |
val1 | Integer value | |
val2 | Integer value |
synchronized void println | ( | String | text, | |
int | val1, | |||
int | val2, | |||
int | val3 | |||
) |
Prints a log message including 3 integer parameters.
text | Log text | |
val1 | Integer value | |
val2 | Integer value | |
val3 | Integer value |
synchronized void println | ( | String | text, | |
int | val1, | |||
int | val2, | |||
int | val3, | |||
int | val4 | |||
) |
Prints a log message including 4 integer parameters.
text | Log text | |
val1 | Integer value | |
val2 | Integer value | |
val3 | Integer value | |
val4 | Integer value |
synchronized void printHexDump | ( | byte[] | dataArr, | |
int | ofs, | |||
int | len | |||
) |
Prints an array of bytes in hexadecimal notation.
dataArr | Data bytes to outStream.print as chars | |
ofs | Subarray offset | |
len | Number of bytes to outStream.print |
synchronized void printAsciiDump | ( | byte[] | dataArr, | |
int | ofs, | |||
int | len | |||
) |
Interprets the data bytes as ASCII characters and outStream.prints them.
dataArr | Data bytes to outStream.print as chars | |
ofs | Subarray offset | |
len | Number of bytes to outStream.print |