andyburke / UnityHTTP

A TcpClient-based HTTP library for Unity.
GNU General Public License v2.0
593 stars 147 forks source link

Ability to change logging behavior #69

Closed zlumer closed 7 years ago

zlumer commented 7 years ago

I've been using UnityHTTP for some time now, and have found one feature very helpful: the ability to change logging behavior.

This PR introduces 3 different logging behaviors: UnityLogger (prints to Unity console), ConsoleLogger (prints to System.Console) and DiscardLogger (discards logs without actually printing anything).

The loggers can be set per each request, default logger is stored in Request.Logger.

The default behavior wasn't changed, I even left some of the #defines in place to maintain 100% char-to-char backwards compatibility.

andyburke commented 7 years ago

lgtm, thanks!

zlumer commented 7 years ago

Thanks for merging!