B4J Question Redirected console log - strange chars

rosippc64a

Active Member
Licensed User
Longtime User
Hi All,
has anyone seen this before? I redirect output with @Erel code:
B4X:
   #if RELEASE
    Dim out As OutputStream = File.OpenOutput(Dir, filename, True) 'Set to True to append the logs
    Dim ps As JavaObject
    ps.InitializeNewInstance("java.io.PrintStream", Array(out, True, "utf8"))
    Dim jo As JavaObject
    jo.InitializeStatic("java.lang.System")
    jo.RunMethod("setOut", Array(ps))
    jo.RunMethod("setErr", Array(ps))
    Log("************************")
    Log("P R O G R A M  I N D U L")
    Log("************************")
   #end if
The log is appended to previous log file. At every first program start the log lines looks like (bad):
B4X:
~l0288277012:************************

~l0288277013:P R O G R A M  I N D U L

~l0288277014:************************

[B@31f08553 6
At the next program start looks like (good):
B4X:
************************
P R O G R A M  I N D U L
************************
[B@15bb2328 6
At next program start looks bad.
I use java 8.
does anyone know the cause?
Steven
 
Top