jpos / jPOS

jPOS Project
http://jpos.org
GNU Affero General Public License v3.0
607 stars 460 forks source link

Add comment to dump Bitmap in the ISOMsg dump. #488

Open chhil opened 2 years ago

chhil commented 2 years ago

https://github.com/jpos/jPOS/blob/866254a44f1652977d2f607c8bc9e49fc21cfeff/jpos/src/main/java/org/jpos/iso/ISOMsg.java#L523

It would be nice to add a comment here, something to the effect

/*
If you want the bitmap dumped in the log, change the condition from (i >= 0) to (i >= -1). 
*/

In the older version of jPOS there was commented out code to do it and since I needed it, I went with customizing it to use -1.

    <isomsg direction="incoming">
      <!-- org.jpos.iso.packager.GenericPackager[cfg/banknet_ebcidic_pci.xml] -->
      <field id="bitmap" value="{2, 3, 4, 6, 7, 10, 11, 12, 13, 14, 15, 16, 18, 22, 28, 32, 33, 35, 37, 41, 42, 43, 48, 49, 51, 61, 63}" type="bitmap"/>
      <field id="0" value="0100"/>
...
...
ar commented 2 years ago

Enabled fields are shown in their respective XML elements? Why would you want to dump an interpreted version of the bitmap?

When packager-debug is enabled, then the bitmap gets dumped if that's what you need.

That said, if you want to add that comment, I'm fine with it, feel free to send a PR.

chhil commented 2 years ago

Enabled fields are shown in their respective XML elements? Why would you want to dump an interpreted version of the bitmap?

Its something the client wanted.

When packager-debug is enabled, then the bitmap gets dumped if that's what you need.

That does excessive logging.

ar commented 2 years ago

There's a subtle problem here. If this is a new ISOMsg you are creating, and it didn't get packed already, then there would be no bitmap. I think a good trade off is to log this info in the TransactionManager, using ctx.log.

That said, I'll keep this issue open in case we figure out a good configurable solution.