#!/bin/bash

# Copyright (C) 2009 Google Inc.

# This file is automatically generated, do not edit!

# Log all stderr output from nxserver-login and children
# (should only be critical errors)

PROGNAME=$(basename "$0")
PRIORITY=""

log() {
  logger -t "$PROGNAME[$$]" -p "user.${PRIORITY:-crit}" -- "$@"
}

# Duplicate stdout to fd 3
exec 3>&1
exec /usr/lib/neatx/nxnode "$@" 2>&1 >&3 | {
  PRIORITY=debug log "Started"
  while read; do
    log "$REPLY"
  done
  PRIORITY=debug log "EOF on stderr, exiting"
}
