Simplified log format under release building.
Removed obsoleted log code.
Removed 2 debug outputs.
Added SIGPIPE processing.
Eliminated a type convertion warning.