• Libraries
  • Shop
  • Doc
  • Free Modbus
  • Support
  • Login
  • Introduction
  • Chapters
  • Modules
  • Classes
  • Class List
  • Class Members
  • com
  • focus_sw
  • util
  • Logger
Public Member Functions | Static Package Functions

Logger Class Reference

Logger class. More...

List of all members.

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.

Detailed Description

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

See also:
PrintStream

Constructor & Destructor Documentation

Logger ( String  categoryName  ) 

Creates a new Logger instance.

Parameters:
categoryName A log category name (typically 4 letters)

Member Function Documentation

static synchronized void categoryEnable ( String  categoryName  )  [static]

Enabled log outputs for this category.

Parameters:
categoryName The log category name
static synchronized void categoryDisable ( String  categoryName  )  [static]

Disables log outputs for this category.

Parameters:
categoryName The log category name
synchronized void println ( String  text  ) 

Prints a log message.

Parameters:
text Log text
synchronized void println ( String  text,
int  val1 
)

Prints a log message including 1 integer parameter.

Parameters:
text Log text
val1 Integer value
synchronized void println ( String  text,
int  val1,
int  val2 
)

Prints a log message including 2 integer parameters.

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.

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.

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.

Parameters:
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.

Parameters:
dataArr Data bytes to outStream.print as chars
ofs Subarray offset
len Number of bytes to outStream.print

FieldTalk Modbus Master Library, Java Edition
Library version 2.6.5
Speak to the Experts
Modbus Organization Member logo

We are member of the Modbus Organization, Inc.

Buy with Confidence
30-day money back guarantee All our FieldTalk web sales are backed by a 30-day Money Back Guarantee.
We Accept
Bank VISA MasterCard PayPal
Customer Info
  • Info & Contact
  • Customer Login
  • Terms of Service
  • Terms of Sale
  • Privacy Policy
© 2005-2025 proconX Pty Ltd. All rights reserved. proconX and FieldTalk are trademarks of proconX Pty Ltd.
All other trademarks and registered trademarks appearing on www.modbusdriver.com are the property of their respective owners.