Skip to content
This repository was archived by the owner on Feb 20, 2026. It is now read-only.

Commit 8bccc28

Browse files
authored
Make logging configurable and disabled by default (#9)
1 parent 2b95f70 commit 8bccc28

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,8 @@
2727
- Check that Doppler CLI is installed
2828
- Add support for CLI and Personal tokens
2929
- Improved README
30-
- Fix paths issue preventing wheel build on Windows
30+
- Fix paths issue preventing wheel build on Windows
31+
32+
## 0.3.1 December 8, 2022
33+
34+
- Logging is now disabled by default and can be enabled by setting the `DOPPLER_ENV_LOGGING` environment variable.

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# doppler-env
22

33
The doppler-env package automates the injection of Doppler secrets as environment variables into any Python application and works in the terminal, PyCharm, and Visual Studio Code.
4+
45
## Motivation
56

67
The Doppler CLI provides the easiest method of injecting secrets into your application:
@@ -35,6 +36,12 @@ First, define the `DOPPLER_ENV` environment variable in your IDE, editor, or ter
3536
export DOPPLER_ENV=1
3637
```
3738

39+
You can enable logging for troubleshooting purposes by setting the `DOPPLER_ENV_LOGGING` environment variable:
40+
41+
```sh
42+
export DOPPLER_ENV_LOGGING=1
43+
```
44+
3845
Then configure which secrets to fetch for your application by either using the CLI in the root directory of your application:
3946

4047
```sh
@@ -55,6 +62,8 @@ In restrictive environments where the use of the Doppler CLI isn't possible, set
5562

5663

5764
```sh
65+
export DOPPLER_TOKEN='dp.st.dev.xxxxxxx'
66+
5867
python app.py
5968

6069
# >> [doppler-env]: DOPPLER_ENV and DOPPLER_TOKEN environment variable set. Fetching secrets from Doppler API

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
setup(
66
name='doppler_env',
7-
version='0.3.0',
7+
version='0.3.1',
88
python_requires='>=3.6',
99
description='Inject Doppler secrets as environment variables into your Python application during local development with debugging support for PyCharm and Visual Studio Code.',
1010
long_description=open('README.md').read(),

src/doppler_env/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212

1313
from dotenv import load_dotenv
1414

15+
LOGGING_ENABLED = True if os.environ.get('DOPPLER_ENV_LOGGING') is not None else False
16+
1517

1618
def log(message):
17-
print('[doppler-env]: {}'.format(message))
19+
if LOGGING_ENABLED:
20+
print('[doppler-env]: {}'.format(message))
1821

1922

2023
def print_debug_info(doppler_token=None, project=None, config=None):

0 commit comments

Comments
 (0)