JBC API for TAFC Logger

This section explains the functionality of JBC API, which is a wrapper for TAFC logger. JBC API enables the JBASE BASIC code to use TAFC logger library. It works similar to TAFC logger library and provides you a function to generate logging at different levels shown below.

  • TAFC_LOG_INFO
  • TAFC_LOG_WARNING
  • TAFC_LOG_ERROR
  • TAFC_LOG_FATAL
NOTE: TAFC_LOG_FATAL can terminate application.

TAFC logger can use the same set of logger variables in tafc.ini. You can however configure the JBC logger variable using [jBC] section.

JBC API Logger function is given below.

Logger(VAR Category, VAR Severity, VAR Message)

Sample program on how to use Logger function is given below.

INCLUDE JBC.h
Logger("CUSTOMER", TAFC_LOG_INFO, "Test Program JBC-CUSTOMER")
Logger("ACCOUNT", TAFC_LOG_WARNING, "Test Program for JBC-ACCOUNT")
Logger("FUND-TRANSFER", TAFC_LOG_ERROR, "Test Program for JBC-FUND-TRANSFER"

The following screen capture displays the commands used to compile and generate executables.

This program produces the log files shown in the following screen capture.

The generated log files are:

  • INFO Log File

  • WARNING Log File

  • ERROR Log File

You can define jBC section for logger variables in tafc.ini file as shown below.

NOTE: The minimum log level for jBC is ERROR superseding the generic log level. Therefore, the errors of level ERROR and above can be logged for any jBC code.

Within jBC, each product can have individual sections such as CUSTOMER, ACCOUNT or FUNDSTRANSFER as shown in the following sample.

[CUSTOMER]
MINLOGLEVEL_FILE=INFO
[ACCOUNT]
MINLOGLEVEL_FILE=ERROR
[FUND-TRANSFER]
MINLOGLEVEL_FILE=WARNING

Bookmark Name Actions
Feedback
x