getsentry/raven-php — pull request #182 by dmitry-kulikov (2014-12-08 20:31:14+00:00)
Title: message_limit option added to allow adjust message size.

I noticed that you use "magic" constants to restrict message size and from time to time you decrease them.
https://github.com/getsentry/raven-php/pull/139/files
https://github.com/getsentry/raven-php/pull/160/files
As I understand it is almost impossible (or very hard) to intelligently restrict message size without using of hardcoded constants. Problem goes from complexity of data and usage of such functions like `Raven_Compat::json_encode`, `gzcompress` and `base64_encode` etc.
As I understand main restriction of message size goes from UDP. Probably 1024 is still too much and you will need to decrease this value again. However HTTP POST allows rather large amount of data. Since I usually use HTTP and verbose error messages, I would like to have messages with more than 1024 characters in Sentry. This pull request introduces `message_limit` option, which allows to developer to set his own value for limit. However as before it does not guarantee length of whole message.

Please review changes and let me know whether need to fix something.

I personally don't like such calls:
```
Raven_Stacktrace::get_stack_info($trace, $this->trace, $this->shift_vars, $vars, $this->message_limit);
```
may be it makes sense to use whole `$this` object as parameter, however it will cause notable changes in method and it will be needed to rewrite some unit tests.