Skip to content

Commit

Permalink
changed: default print created variables to False
Browse files Browse the repository at this point in the history
  • Loading branch information
henriquelino committed Jul 18, 2023
1 parent 29422dc commit 044a4a9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@

<a id='changelog-v0.1.0.6'></a>
# v0.1.0.6 — 2023-07-18

## Changed

- Changed default print created variables to False

<a id='changelog-v0.1.0.5'></a>
# v0.1.0.5 — 2023-03-02

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "configjy"
version = "v0.1.0.5"
version = "v0.1.0.6"
description = "Loads a json or yaml config file"
authors = ["henrique lino <henrique.lino97@gmail.com>"]
readme = "README.md"
Expand Down
10 changes: 8 additions & 2 deletions src/configjy/ConfigFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,16 @@ def __load_config_vars(self, config: dict) -> None:
self.loaded_vars[key] = value

if self.print_when_create:
logger.critical(f"\n{'-'*60}\nVariavel criada:\nNome: '{key}'\nValor: '{json.dumps(value, indent = 4, default = str)}'\nTipo: '{type(value)}'\n{'-'*60}\n")
logger.debug(f"\n{'-'*60}\nVariavel criada:\nNome: '{key}'\nValor: '{json.dumps(value, indent = 4, default = str)}'\nTipo: '{type(value)}'\n{'-'*60}\n")
return

def __init__(self, path: Union[str, Path], *, name="config", extensions=(".yaml", ".yml", ".json"), print_when_create=True):
def __init__(
self,
path: Union[str, Path],
*,
name="config",
extensions=(".yaml", ".yml", ".json"),
print_when_create=False):
"""Loads file content into a class
If path to a file is given, uses the path, else searchs for name + extensions\n
#### Usage:\n
Expand Down

0 comments on commit 044a4a9

Please sign in to comment.