Please edit your post to provide your code as preformatted text. See Wiki - how to post code on this forum.
You can edit your post by clicking the pencil Icon in the lower right of your post.
Also, if this is being run in a vision client then you will not see these logs in the gateway log, only the local client log.