mirror of
https://github.com/User0332/rewards-farmer.git
synced 2026-09-16 01:31:36 +00:00
merge the logging work into the feature branch
Both change main.py and README.md, and three separate pull requests touching the same entry point is worse for review than one. Resolved by keeping every section of the README and folding the logging setup into the new multi-account main, so the profile-in-use message from #35 is now a logger.error and uses log_utils.exception_summary rather than repeating the truncation inline. queries.py moves to logging with the rest of the runtime.
This commit is contained in:
@@ -108,5 +108,25 @@ REWARDS_ACCOUNTS=personal,spare docker compose run --rm rewards-farmer
|
||||
```
|
||||
|
||||
`REWARDS_HEADLESS=1` is set in the image. It also works on the host if you want a run with no visible window; the pointer code needs an explicit window size in that mode, which `main.py` sets.
|
||||
# Logging
|
||||
|
||||
The script logs to the console. Two optional environment variables change that:
|
||||
|
||||
| Variable | Default | Effect |
|
||||
| --- | --- | --- |
|
||||
| `REWARDS_FARMER_LOG_LEVEL` | `INFO` | Set to `DEBUG` to also attach the full stack trace to every `[FAIL]` line. |
|
||||
| `REWARDS_FARMER_LOG_FILE` | unset | Path to also write the log to, useful for unattended runs. |
|
||||
|
||||
Windows (PowerShell)
|
||||
```sh
|
||||
$env:REWARDS_FARMER_LOG_LEVEL="DEBUG"; $env:REWARDS_FARMER_LOG_FILE="run.log"; python src/main.py
|
||||
```
|
||||
|
||||
*nix (Bash)
|
||||
```sh
|
||||
REWARDS_FARMER_LOG_LEVEL=DEBUG REWARDS_FARMER_LOG_FILE=run.log python src/main.py
|
||||
```
|
||||
|
||||
If you are opening an issue about a crash, running with `REWARDS_FARMER_LOG_LEVEL=DEBUG` and attaching the log is the most useful thing you can include.
|
||||
|
||||
Please open up a GitHub issue if you run into any difficulties.
|
||||
Reference in New Issue
Block a user