[Gambas-user] Logging errors in apps running as Application.Daemon

Tobias Boege taboege at ...626...
Wed Jun 21 13:56:43 CEST 2017


On Wed, 21 Jun 2017, Tobias Boege wrote:
> Attached are two scripts

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
-------------- next part --------------
#!/usr/bin/gbs3

Public Sub Main()
  Print "a"
  Application.Daemon = True
  Wait 0.1 ' ensure we daemon'd(?)
  Print "b"
  Print 1 / 0
  Print "c"
End
-------------- next part --------------
#!/usr/bin/gbs3

Public Sub Main()
  Dim h, g As File

  h = Open "/tmp/log" For Write Create
  Output To #h
  g = Open "/tmp/log2" For Write Create
  Error To #g

  Print "a"
  Application.Daemon = True
  Wait 0.1 ' ensure we daemon'd(?)
  Print "b"
  Print 1 / 0
  Print "c"

  Close #h
  Close #g
End


More information about the User mailing list