Fixing logstream crash when using another stream other than stdout