summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2013-04-12 00:14:33 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2013-06-14 01:10:04 +0200
commit2cb136cfb8ef1d4b3a2cb68c4cbc23547bfc395f (patch)
tree9dc7cc3e9e56488326899feb37f612161969159a /README
parenta4460de7719eb8c8bb1f3aa72b2ce233b45d9a87 (diff)
downloadfactory-boy-2cb136cfb8ef1d4b3a2cb68c4cbc23547bfc395f.tar
factory-boy-2cb136cfb8ef1d4b3a2cb68c4cbc23547bfc395f.tar.gz
Add logging calls (Closes #45).
Diffstat (limited to 'README')
-rw-r--r--README28
1 files changed, 28 insertions, 0 deletions
diff --git a/README b/README
index 06f3393..8586e1d 100644
--- a/README
+++ b/README
@@ -184,6 +184,34 @@ The associated object's strategy will be used:
True
+Debugging factory_boy
+"""""""""""""""""""""
+
+Debugging factory_boy can be rather complex due to the long chains of calls.
+Detailed logging is available through the ``factory`` logger:
+
+.. code-block:: python
+
+ import logging
+ logger = logging.getLogger('factory')
+ logger.addHandler(logging.StreamHandler())
+ logger.setLevel(logging.DEBUG)
+
+This will yield messages similar to those (artificial indentation):
+
+.. code-block:: ini
+
+ BaseFactory: Preparing tests.test_using.TestModel2Factory(extra={})
+ LazyStub: Computing values for tests.test_using.TestModel2Factory(two=<OrderedDeclarationWrapper for <factory.declarations.SubFactory object at 0x1e15610>>)
+ SubFactory: Instantiating tests.test_using.TestModelFactory(__containers=(<LazyStub for tests.test_using.TestModel2Factory>,), one=4), create=True
+ BaseFactory: Preparing tests.test_using.TestModelFactory(extra={'__containers': (<LazyStub for tests.test_using.TestModel2Factory>,), 'one': 4})
+ LazyStub: Computing values for tests.test_using.TestModelFactory(one=4)
+ LazyStub: Computed values, got tests.test_using.TestModelFactory(one=4)
+ BaseFactory: Generating tests.test_using.TestModelFactory(one=4)
+ LazyStub: Computed values, got tests.test_using.TestModel2Factory(two=<tests.test_using.TestModel object at 0x1e15410>)
+ BaseFactory: Generating tests.test_using.TestModel2Factory(two=<tests.test_using.TestModel object at 0x1e15410>)
+
+
ORM Support
"""""""""""