museumsvictoria / nodel

A digital media control system for museums and galleries
nodel.io
60 stars 17 forks source link

Within `@at_cleanup` method, `print` only goes to standard out, not node's console #325

Open justparking opened 4 months ago

justparking commented 4 months ago

Not that @at_cleanup is used all that much but I've just noticed that using print will cause output to go ONLY to standard out process stream, not the node's console:

@at_cleanup
def cleanup_resources():
  console.info("Cleaning up...")
  _importantResource.close()
  print "All cleaned up!"

After that node is recycled or shutdown, only the text Cleaning up... goes to the console. All cleaned up! ends up in the general standard out for that JVM process.

print normally strictly goes to the node's console.