Skip to content

Commit 534014c

Browse files
committed
Move logging and tests to docs/development.
1 parent ed88036 commit 534014c

File tree

2 files changed

+31
-28
lines changed

2 files changed

+31
-28
lines changed

README.md

-28
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ For more information on farmOS, visit [farmOS.org](https://farmOS.org).
2222
- [Client methods](#client-methods)
2323
- [farmOS 1.x](docs/client_1x.md)
2424
- [farmOS 2.x](docs/client_2x.md)
25-
- [Logging](#logging)
2625

2726

2827
## Installation
@@ -199,33 +198,6 @@ methods depending on the server version:
199198
- [1.x methods](docs/client_1x.md)
200199
- [2.x methods](docs/client_2x.md)
201200

202-
### Logging
203-
204-
You can configure how `farmOS` logs are displayed with the following:
205-
```python
206-
import logging
207-
208-
# Required to init a config on the ROOT logger, that all other inherit from
209-
logging.basicConfig()
210-
211-
# Configure all loggers under farmOS (farmOS.client, famrOS.session) to desired level
212-
logging.getLogger("farmOS").setLevel(logging.DEBUG)
213-
214-
# Hide debug logging from the farmOS.session module
215-
logging.getLogger("farmOS.session").setLevel(logging.WARNING)
216-
```
217-
More info on logging in Python [here](https://docs.python.org/3/howto/logging.html#logging-basic-tutorial).
218-
219-
## TESTING
220-
Functional tests require a live instance of farmOS to communicate with.
221-
Configure credentials for the farmOS instance to test against by setting the following environment variables:
222-
223-
`FARMOS_HOSTNAME`, `FARMOS_OAUTH_USERNAME`, `FARMOS_OAUTH_PASSWORD`, `FARMOS_OAUTH_CLIENT_ID`, `FARMOS_OAUTH_CLIENT_SECRET`
224-
225-
Automated tests are run with pytest:
226-
227-
python setup.py test
228-
229201
## MAINTAINERS
230202

231203
* Paul Weidner (paul121) - https://github.com/paul121

docs/development.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# farmOS.py development
2+
3+
## Logging
4+
5+
You can configure how `farmOS` logs are displayed with the following:
6+
```python
7+
import logging
8+
9+
# Required to init a config on the ROOT logger, that all other inherit from
10+
logging.basicConfig()
11+
12+
# Configure all loggers under farmOS (farmOS.client, famrOS.session) to desired level
13+
logging.getLogger("farmOS").setLevel(logging.DEBUG)
14+
15+
# Hide debug logging from the farmOS.session module
16+
logging.getLogger("farmOS.session").setLevel(logging.WARNING)
17+
```
18+
More info on logging in Python [here](https://docs.python.org/3/howto/logging.html#logging-basic-tutorial).
19+
20+
## Testing
21+
22+
Functional tests require a live instance of farmOS to communicate with.
23+
Configure credentials for the farmOS instance to test against by setting the following environment variables:
24+
25+
`FARMOS_HOSTNAME`, `FARMOS_OAUTH_USERNAME`, `FARMOS_OAUTH_PASSWORD`, `FARMOS_OAUTH_CLIENT_ID`, `FARMOS_OAUTH_CLIENT_SECRET`
26+
27+
Automated tests are run with pytest:
28+
29+
```bash
30+
$ python setup.py test
31+
```

0 commit comments

Comments
 (0)