I just thought I'd point out that a good way to do deprecation warnings is
to use the 'warnings' system
e.g.
import warnings
class A(object):
def init(self):
warnings.warn("A is deprecated", DeprecationWarning)
A benefit of doing it this was is that PyCharm and other IDE's mark usages
of deprecated functions / classes (pycharm formats it with a strikethrough
wherever it is used). This also doesn't log anything by default unless you
enable it so it won't log on staging / prod (and hence won't clog up
couchlog) .
I've submitted a PR to enable it if running in DEBUG mode:
···
--
Simon Kelly
Senior Engineer | Dimagi South Africa
Very cool. I think I looked around for the Right Way™ to do this and came
up short a little while ago. Glad to see you were able to figure it out. I
agree we should all use this once it's set up.
Cheers,
Danny
···
On Thu, Aug 22, 2013 at 6:47 AM, Simon Kelly wrote:
Hi all
I just thought I'd point out that a good way to do deprecation warnings is
to use the 'warnings' system
e.g.
import warnings
class A(object):
def init(self):
warnings.warn("A is deprecated", DeprecationWarning)
A benefit of doing it this was is that PyCharm and other IDE's mark usages
of deprecated functions / classes (pycharm formats it with a strikethrough
wherever it is used). This also doesn't log anything by default unless you
enable it so it won't log on staging / prod (and hence won't clog up
couchlog) .
Does that include submission history report? Cause we (DSA) were wondering
why that isn't emailable yesterday.
···
On Thu, Aug 22, 2013 at 4:22 PM, Daniel Roberts wrote:
Very cool. I think I looked around for the Right Way™ to do this and came
up short a little while ago. Glad to see you were able to figure it out. I
agree we should all use this once it's set up.
Cheers,
Danny
On Thu, Aug 22, 2013 at 6:47 AM, Simon Kelly skelly@dimagi.com wrote:
Hi all
I just thought I'd point out that a good way to do deprecation warnings
is to use the 'warnings' system
e.g.
import warnings
class A(object):
def init(self):
warnings.warn("A is deprecated", DeprecationWarning)
A benefit of doing it this was is that PyCharm and other IDE's mark
usages of deprecated functions / classes (pycharm formats it with a
strikethrough wherever it is used). This also doesn't log anything by
default unless you enable it so it won't log on staging / prod (and hence
won't clog up couchlog) .
Very cool. I think I looked around for the Right Way™ to do this and came
up short a little while ago. Glad to see you were able to figure it out. I
agree we should all use this once it's set up.
Cheers,
Danny
On Thu, Aug 22, 2013 at 6:47 AM, Simon Kelly skelly@dimagi.com wrote:
Hi all
I just thought I'd point out that a good way to do deprecation warnings
is to use the 'warnings' system
e.g.
import warnings
class A(object):
def init(self):
warnings.warn("A is deprecated", DeprecationWarning)
A benefit of doing it this was is that PyCharm and other IDE's mark
usages of deprecated functions / classes (pycharm formats it with a
strikethrough wherever it is used). This also doesn't log anything by
default unless you enable it so it won't log on staging / prod (and hence
won't clog up couchlog) .