[omniORB] Patch: GIOP stream dumps to omniORB::logger
Matej Kenda
matejkenda@volja.net
Thu Jan 23 15:43:02 2003
This is a multi-part message in MIME format.
--------------040500020604070309020404
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Hi,
I use the omniORB's feature to redirect logging by using a callback function.
However, I have noticed that GIOP hex dumps still go to stderr
(fprintf(stderr, ..)).
Please find attached the patch that changes the dumpbuf() function in
giopStream.cc to write to omniORB::logger.
Best regards,
Matej
--
Matej Kenda, Lead Engineer
HERMES SoftLab
http://www.hermes-softlab.com
--------------040500020604070309020404
Content-Type: text/plain;
name="omniORB4-giopStream.diff"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="omniORB4-giopStream.diff"
LS0tIG9tbmlPUkItNC4wLjAvc3JjL2xpYi9vbW5pT1JCL29yYmNvcmUvZ2lvcFN0cmVhbS5j
YwkyMDAyLTAyLTI1IDEyOjE3OjEzLjAwMDAwMDAwMCArMDEwMAorKysgb21uaU9SQi00LjAu
MC1ub2F1dG8vc3JjL2xpYi9vbW5pT1JCL29yYmNvcmUvZ2lvcFN0cmVhbS5jYwkyMDAzLTAx
LTIzIDE2OjE3OjI3LjAwMDAwMDAwMCArMDEwMApAQCAtMTE2OSw0MyArMTE2OSw0OSBAQAog
ewogICBzdGF0aWMgb21uaV90cmFjZWRtdXRleCBsb2NrOwogICBvbW5pX3RyYWNlZG11dGV4
X2xvY2sgc3luYyhsb2NrKTsKICAgdW5zaWduZWQgaTsKICAgY2hhciByb3dbODBdOworICBv
bW5pT1JCOjpsb2dnZXIgbDsKIAogICBjb25zdCBzaXplX3QgZHVtcGxpbWl0ID0gMTI4Owog
ICBpZiAoIW9tbmlPUkI6OnRyYWNlKDQwKSAmJiBzeiA+IGR1bXBsaW1pdCkgewotICAgIGZw
cmludGYoc3RkZXJyLCIldSBieXRlcyBvdXQgb2YgJXVcbiIsCi0JICAgIGR1bXBsaW1pdCwg
c3opOworICAgIGwgPDwgZHVtcGxp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BpID0gMHU7IGkgPCBz
ejsgaSsrICkKLSAgICAgIGZwcmludGYoc3RkZXJyLCAoaSAmIDF1KSA/ICIlMDJ4ICI6IiUw
MngiLCAoaW50KSBidWZbaV0pOwotICAgIGZvciggOyBpIDwgMTZ1OyBpKysgKQotICAgICAg
ZnByaW50ZihzdGRlcnIsIChpICYgMXUpID8gIiAgICI6IiAgIik7Ci0gICAgZm9yKCBpID0g
MHU7IGkgPCBzejsgaSsrICkKLSAgICAgIGZwcmludGYoc3RkZXJyLCAiJWMiLCBwcmludGFi
bGVfY2hhcihidWZbaV0pKTsKLSAgICBmcHJpbnRmKHN0ZGVyciwiXG4iKTsKKyAgICBmb3Io
IGkgPSAwdTsgaSA8IHN6OyBpKysgKSB7CisgICAgICBzcHJpbnRmKHJvdytyb3dfcG9zLCAo
aSAmIDF1KSA/ICIlMDJ4ICI6IiUwMngiLCAoaW50KSBidWZbaV0pOworICAgICAgcm93X3Bv
cyArPSAoaSUyID09IDApPyAyIDogMzsKKyAgICB9CisgICAgZm9yKCA7IGkgPCAxNnU7IGkr
KyApIHsKKyAgICAgIHNwcmludGYocm93K3Jvd19wb3MsIChpICYgMXUpID8gIiAgICI6IiAg
Iik7CisgICAgICByb3dfcG9zICs9IChpJTIgPT0gMCk/IDIgOiAzOworICAgIH0KKyAgICBm
b3IoIGkgPSAwdTsgaSA8IHN6OyBpKysgKSB7CisgICAgICBzcHJpbnRmKHJvdytyb3dfcG9z
LCAiJWMiLCBwcmludGFibGVfY2hhcihidWZbaV0pKTsKKyAgICAgIHJvd19wb3MrKzsKKyAg
ICB9CisgICAgbCA8PCByb3cgPDwgIlxuIjsKICAgfQogfQogCiBPTU5JX05BTUVTUEFDRV9F
TkQob21uaSkK
--------------040500020604070309020404--