Fixes are available
APAR status
Closed as program error.
Error description
Using the WL.Logger.config JavaScript hybrid function call using the discouraged array syntax for "level" property (like WL.Logger.config({level:['info','debug']}); ) does not affect native code layer logger verbosity. Using string or integer values for the "level" property correctly affects the native code layer logger verbosity. The difference in behavior is incorrect and undocumented.
Local fix
Problem summary
**************************************************************** * USERS AFFECTED: * * Developers of Worklight or MobileFirst applications using * * the array syntax for the "level" property of the object * * passed to the WL.Logger.config function call in JavaScript. * **************************************************************** * PROBLEM DESCRIPTION: * * The use of the array syntax for the level property of the * * options object passed to the WL.Logger.config function in * * JavaScript in a hybrid application does not affect the * * native configuration. For example, the native Logger * * configuration in both Android and iOS could be set to TRACE * * verbosity. A JavaScript function call to * * WL.Logger.config({level:'debug'}); in a hybrid application * * will affect the native logger verbosity configuration. A * * JavaScript function call to * * WL.Logger.config({level:['debug']}); (which is discouraged) * * does not affect the native logger verbosity configuration. * * This is a logic error and is now corrected such that the * * highest verbosity level in the JavaScript configuration * * options array "level" property is passed to th enative code * * layer and becomes the native layer verbosity setting. * **************************************************************** * RECOMMENDATION: * * Until you apply the ifix that addresses this APAR, a simple * * workaround is to call the WL.Logger.config function twice in * * succession, first with the highest verbosity, then with the * * array syntax. Using the array syntax is discouraged because * * it is an unfamiliar pattern for debug log libraries in all * * programming languages. But if you must use the array syntax * * for the config options object in a hybrid application, and * * you expect the levels specified in the object to affect the * * native layer, you may use this workaround until you apply * * the ifix: * * * * WL.Logger.config({level:'debug'}); // applies to hybrid * * JavaScript layer and native * * WL.Logger.config({level:['info','debug']}); // applies to * * hybrid layer only until the ifix is applied, then you may * * remove the above config function call * ****************************************************************
Problem conclusion
The ifix corrects the logic in the JavaScript WL.Logger.config function call such that it processes the array syntax of the "logger" property and applies the most verbose of the array elements to the native layer in a hybrid application.
Temporary fix
Comments
APAR Information
APAR number
PI51804
Reported component name
WL/MFPF ENTERPR
Reported component ID
5725I4300
Reported release
700
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2015-11-03
Closed date
2015-11-23
Last modified date
2015-11-23
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
WL/MFPF ENTERPR
Fixed component ID
5725I4300
Applicable component levels
R610 PSY
UP
R620 PSY
UP
R630 PSY
UP
R700 PSY
UP
R710 PSY
UP
[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSZH4A","label":"IBM Worklight"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"700","Line of Business":{"code":"LOB45","label":"Automation"}}]
Document Information
Modified date:
15 October 2021