maleix: Thanks for the feedback di!
I updated the pull request.

What makes me doubt is how to get the `arguments` variable from the `_vladiate` function in main.py.
Making arguments global or passing it as parameter don't seem clean approaches.


diff --git a/README.rst b/README.rst
index 22f8219..57abdf6 100644
--- a/README.rst
+++ b/README.rst
@@ -341,6 +341,10 @@ Running Vlads Programatically
       Whether to fail validation if there are fields in the file for which the
       `Vlad` does not have validators. Optional, defaults to `False`.
 
+  :``quiet=False``:
+      Whether to disable log output generated by validations.
+      Optional, defaults to `False`.
+
   For example:
 
 .. code:: python
@@ -380,6 +384,7 @@ Command Line Arguments
       -V, --version         show version number and exit
       -p PROCESSES, --processes=PROCESSES
                             attempt to use this number of processes, Default: 1
+      -q, --quiet           disable console log output generated by validations
 
 Authors
 -------
diff --git a/vladiate/main.py b/vladiate/main.py
index b9ca587..d04ba86 100644
--- a/vladiate/main.py
+++ b/vladiate/main.py
@@ -68,6 +68,16 @@ def parse_args():
         help="attempt to use this number of processes",
     )
 
+    # Disable vladiate classes console log output
+    parser.add_argument(
+        "-q",
+        "--quiet",
+        action="store_true",
+        dest="quiet",
+        default=False,
+        help="disable console log output generated by validations",
+    )
+
     return parser.parse_args()
 
 
@@ -162,7 +172,11 @@ def load_vladfile(path):
 
 def _vladiate(vlad):
     global result_queue
-    result_queue.put(vlad(vlad.source, validators=vlad.validators).validate())
+    result_queue.put(
+        vlad(
+            vlad.source, validators=vlad.validators, quiet=parse_args().quiet
+        ).validate()
+    )
 
 
 result_queue = Queue()
@@ -213,7 +227,7 @@ def main():
     all_passed = True
     if arguments.processes == 1:
         for vlad in vlad_classes:
-            passed = vlad(source=vlad.source).validate()
+            passed = vlad(source=vlad.source, quiet=arguments.quiet).validate()
             all_passed = all_passed and passed
 
     else:
diff --git a/vladiate/vlad.py b/vladiate/vlad.py
index c11c027..7e09efe 100644
--- a/vladiate/vlad.py
+++ b/vladiate/vlad.py
@@ -14,6 +14,7 @@ class Vlad(object):
         default_validator=EmptyValidator,
         delimiter=None,
         ignore_missing_validators=False,
+        quiet=False,
     ):
         self.logger = logs.logger
         self.failures = defaultdict(lambda: defaultdict(list))
@@ -24,6 +25,7 @@ class Vlad(object):
         self.delimiter = delimiter or getattr(self, "delimiter", ",")
         self.line_count = 0
         self.ignore_missing_validators = ignore_missing_validators
+        self.logger.disabled = quiet
 
         self.validators.update(
             {

add a quiet option (-q)
Hi,

After the vladiate 0.0.20, I could get the shell exitcode for success or not.

Now I would like to add a quiet option (-q) so that when I call vladiate, it silently validates, if not it will throw an error.

Best
diff --git a/tests/test_main.py b/tests/test_main.py
index 60ea61a..838b552 100644
--- a/tests/test_main.py
+++ b/tests/test_main.py
@@ -119,6 +119,7 @@ def test_main_with_multiprocess(monkeypatch, get, expected):
             vladfile=stub(),
             vlads=["Something"],
             processes=2,
+            quiet=False,
         ),
     )
     monkeypatch.setattr("vladiate.main.find_vladfile", lambda *args, **kwargs: stub())
@@ -156,6 +157,7 @@ def test_main_with_vlads_in_args(monkeypatch):
             vladfile=stub(),
             vlads=["Something"],
             processes=1,
+            quiet=False,
         ),
     )
     monkeypatch.setattr("vladiate.main.find_vladfile", lambda *args, **kwargs: stub())
@@ -178,6 +180,7 @@ def test_main_no_vlads_in_args(monkeypatch):
             vladfile=stub(),
             vlads=[],
             processes=1,
+            quiet=False,
         ),
     )
     monkeypatch.setattr("vladiate.main.find_vladfile", lambda *args, **kwargs: stub())
diff --git a/tests/test_vlads.py b/tests/test_vlads.py
index dc174fc..e9b1453 100644
--- a/tests/test_vlads.py
+++ b/tests/test_vlads.py
@@ -110,6 +110,21 @@ def test_ignore_missing_validators():
     assert vlad.missing_validators == {"Column B"}
 
 
+def test_quiet(caplog):
+    source = LocalFile("vladiate/examples/vampires.csv")
+
+    class TestVlad(Vlad):
+        validators = {
+            "Column A": [UniqueValidator()],
+            "Column B": [SetValidator(["Vampire", "Not A Vampire"])],
+        }
+
+    vlad = TestVlad(source=source, quiet=True)
+
+    assert vlad.validate()
+    assert len(caplog.records) == 0
+
+
 def test_when_bad_is_non_iterable():
     source = String("Column A,Column B\n,foo")
 

pip install -e .[s3]
parse_log_pytest
requirements.txt
pretend pytest black
3.7
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
black==23.3.0
boto==2.49.0
certifi @ file:///croot/certifi_1671487769961/work/certifi
click==8.1.8
exceptiongroup==1.2.2
importlib-metadata==6.7.0
iniconfig==2.0.0
mypy-extensions==1.0.0
packaging==24.0
pathspec==0.11.2
platformdirs==4.0.0
pluggy==1.2.0
pretend==1.0.9
pytest==7.4.4
tomli==2.0.1
typed-ast==1.5.5
typing_extensions==4.7.1
-e git+https://github.com/di/vladiate.git@7580d0cee219e5ca6025b8c8e89efff94fd229ca#egg=vladiate
zipp==3.15.0

name: vladiate
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - black==23.3.0
      - boto==2.49.0
      - click==8.1.8
      - exceptiongroup==1.2.2
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - mypy-extensions==1.0.0
      - packaging==24.0
      - pathspec==0.11.2
      - platformdirs==4.0.0
      - pluggy==1.2.0
      - pretend==1.0.9
      - pytest==7.4.4
      - tomli==2.0.1
      - typed-ast==1.5.5
      - typing-extensions==4.7.1
      - zipp==3.15.0
prefix: /opt/conda/envs/vladiate

tests/test_vlads.py::test_quiet
tests/test_main.py::test_parse_args tests/test_main.py::test_main_no_vladfile
tests/test_main.py::test_is_vlad[tup0-False] tests/test_main.py::test_is_vlad[tup1-True] tests/test_main.py::test_find_vladfile[vladfile-./vladiate/examples/] tests/test_main.py::test_find_vladfile[./vladiate/examples/vladfile-.] tests/test_main.py::test_load_vladfile[./vladiate/examples/vladfile] tests/test_main.py::test_load_vladfile[/vladiate/vladfile] tests/test_main.py::test_load_vladfile[/opt/conda/envs/vladiate/bin/vladfile] tests/test_main.py::test_run tests/test_main.py::test_main_with_multiprocess[<lambda>-0] tests/test_main.py::test_main_with_multiprocess[<lambda>-65] tests/test_main.py::test_main_with_vlads_in_args tests/test_main.py::test_main_no_vlads_in_args tests/test_main.py::test_main_missing_vlads tests/test_main.py::test_main_no_vlads_loaded tests/test_main.py::test_main_list_commands tests/test_main.py::test_main_show_version tests/test_main.py::test_is_package[foo/bar-False] tests/test_main.py::test_is_package[vladiate/examples-True] tests/test_vlads.py::test_initialize_vlad tests/test_vlads.py::test_initialize_vlad_with_alternative_delimiter tests/test_vlads.py::test_initialize_vlad_no_source tests/test_vlads.py::test_unused_validator_fails_validation tests/test_vlads.py::test_validators_in_class_variable_are_used tests/test_vlads.py::test_missing_validators tests/test_vlads.py::test_no_fieldnames tests/test_vlads.py::test_fails_validation tests/test_vlads.py::test_gt_99_failures tests/test_vlads.py::test_ignore_missing_validators tests/test_vlads.py::test_when_bad_is_non_iterable
README.rst vladiate/main.py vladiate/vlad.py
README.rst vladiate/main.py vladiate/vlad.py