drewejohnson: Reopened to squash and merge
diff --git a/serpentTools/__init__.py b/serpentTools/__init__.py
index fdaf895..8d07887 100644
--- a/serpentTools/__init__.py
+++ b/serpentTools/__init__.py
@@ -3,10 +3,6 @@ from serpentTools import parsers
 
 
 # List TODOS/feature requests here for now
-# Messages/Errors
-# TODO: Add verbosity control
-# TODO: Add specific exceptions and warnings
-# TODO: Add logging module to help with warnings/exceptions/info
 # Compatability
 # TODO: Python 2 support
 # TODO: Test compatability with earlier numpy releases
@@ -14,9 +10,10 @@ from serpentTools import parsers
 # TODO: Update rc with dictionary
 # TODO: Update rc with yaml file into dictionary
 # TODO: Capture materials with underscores for depletion
-# TODO: Better version string management
 
 
 from ._version import get_versions
 __version__ = get_versions()['version']
 del get_versions
+
+settings.messages.info('Using version {}'.format(__version__))
diff --git a/serpentTools/parsers/depletion.py b/serpentTools/parsers/depletion.py
index 002f516..6c2ff82 100644
--- a/serpentTools/parsers/depletion.py
+++ b/serpentTools/parsers/depletion.py
@@ -8,6 +8,8 @@ from drewtils.parsers import KeywordParser
 from serpentTools.objects.readers import MaterialReader
 from serpentTools.objects.materials import DepletedMaterial
 
+from serpentTools.settings import messages
+
 
 class DepletionReader(MaterialReader):
     """Parser responsible for reading and working with depletion files.
@@ -60,10 +62,13 @@ class DepletionReader(MaterialReader):
         """Return the patterns by which to find the requested materials."""
         patterns = self.settings['materials'] or ['.*']
         # match all materials if nothing given
+        if any(['_' in pat for pat in patterns]):
+            messages.warning('Materials with underscores are not supported.')
         return [re.compile(mat) for mat in patterns]
 
     def read(self):
         """Read through the depletion file and store requested data."""
+        messages.info('Preparing to read {}'.format(self.filePath))
         keys = ['MAT', 'TOT'] if self.settings['processTotal'] else ['MAT']
         keys.extend(self.settings['metadataKeys'])
         separators = ['\n', '];']
@@ -74,6 +79,8 @@ class DepletionReader(MaterialReader):
                 elif (('TOT' in chunk[0] and self.settings['processTotal'])
                       or 'MAT' in chunk[0]):
                     self._addMaterial(chunk)
+        messages.info('Done reading depletion file')
+        messages.debug('  found {} materials'.format(len(self.materials)))
 
     def _addMetadata(self, chunk):
         options = {'ZAI': 'zai', 'NAMES': 'names', 'DAYS': 'days',
diff --git a/serpentTools/settings/__init__.py b/serpentTools/settings/__init__.py
index 2223fc0..09f5fdb 100644
--- a/serpentTools/settings/__init__.py
+++ b/serpentTools/settings/__init__.py
@@ -1,4 +1,5 @@
 """Settings to yield control to the user."""
+from serpentTools.settings import messages
 
 defaultSettings = {
     'depletion.metadataKeys': {
@@ -23,6 +24,13 @@ defaultSettings = {
         'default': True,
         'description': 'Option to store the depletion data from the TOT block',
         'type': bool
+    },
+    'verbosity': {
+        'default': 'warning',
+        'options': messages.LOG_OPTS,
+        'type': str,
+        'description': 'Set the level of errors to be shown.',
+        'updater': messages.updateLevel
     }
 }
 
@@ -30,12 +38,13 @@ defaultSettings = {
 class DefaultSetting(object):
     """Store a single setting."""
 
-    def __init__(self, name, default, varType, description, options):
+    def __init__(self, name, default, varType, description, options, updater):
         self.name = name
         self.description = description
         self.default = default
         self.type = varType
         self.options = options
+        self.updater = updater
 
     def __repr__(self):
         return '<DefaultSetting {}: value: {}>'.format(self.name, self.default)
@@ -82,7 +91,8 @@ class DefaultSettingsLoader(dict):
         dict.__init__(self, self._load())
         self.__locked__ = True
 
-    def _load(self):
+    @staticmethod
+    def _load():
         """Load the default setting objects."""
         defaults = {}
         for name, value in defaultSettings.items():
@@ -95,7 +105,8 @@ class DefaultSettingsLoader(dict):
                                'default': value['default'],
                                'varType': value['type'],
                                'options': options,
-                               'description': value['description']
+                               'description': value['description'],
+                               'updater': value.get('updater', None)
                                }
             defaults[name] = DefaultSetting(**settingsOptions)
         return defaults
@@ -163,14 +174,17 @@ class UserSettingsLoader(dict):
             raise KeyError('Setting {} does not exist'.format(name))
         self._defaultLoader[name].validate(value)
         # if we've made it here, then the value is valid
+        if self._defaultLoader[name].updater is not None:
+            value = self._defaultLoader[name].updater(value)
         dict.__setitem__(self, name, value)
+        messages.debug('Updated setting {} to {}'.format(name, value))
 
     def getReaderSettings(self, readerName):
         """Get all module-wide and reader-specific settings.
 
         Parameters
         ----------
-        readerLevel: str
+        readerName: str
             Name of the specific reader.
             Will look for settings with lead with ``readerName``, e.g.
             ``depletion.metadataKeys``
diff --git a/serpentTools/settings/messages.py b/serpentTools/settings/messages.py
new file mode 100644
index 0000000..a0fa0b0
--- /dev/null
+++ b/serpentTools/settings/messages.py
@@ -0,0 +1,84 @@
+"""
+System-wide methods for producing status update and errors.
+
+See Also
+--------
+https://docs.python.org/2/library/logging.html
+https://www.python.org/dev/peps/pep-0391/
+http://docs.python-guide.org/en/latest/writing/logging/
+https://docs.python.org/2/howto/logging-cookbook.html#logging-cookbook
+https://fangpenlin.com/posts/2012/08/26/good-logging-practice-in-python/
+"""
+
+
+import logging
+from logging.config import dictConfig
+
+
+class SerpentToolsException(Exception):
+    """Base-class for all exceptions in this project"""
+    pass
+
+
+LOG_OPTS = ['critical', 'error', 'warning', 'info', 'debug']
+
+
+loggingConfig = {
+    'version': 1,
+    'formatters': {
+        'brief': {'format': '%(levelname)-8s: %(name)-15s: %(message)s'},
+        'precise': {
+            'format': '%(asctime)s %(name)-12s %(levelname)-8s %(message)s'
+        }
+    },
+    'handlers': {
+        'console': {
+            'class': 'logging.StreamHandler',
+            'formatter': 'brief',
+            'level': logging.DEBUG,
+            'stream': 'ext://sys.stdout'
+        }
+    },
+    'root': {
+        'handlers': ['console'],
+        'level': logging.INFO
+    }
+}
+
+dictConfig(loggingConfig)
+
+__logger__ = logging.getLogger('serpentTools')
+
+
+def debug(message):
+    """Log a debug message."""
+    __logger__.debug('%s', message)
+
+
+def info(message):
+    """Log an info message, e.g. status update."""
+    __logger__.info('%s', message)
+
+
+def warning(message):
+    """Log a warning that something that could go wrong or be avoided."""
+    __logger__.warning('%s', message)
+
+
+def error(message, fatal=True):
+    """Log that something went wrong."""
+    if fatal:
+        __logger__.critical('%s', message, exc_info=True)
+        raise SerpentToolsException('%s', message)
+    __logger__.error('%s', message)
+
+
+def updateLevel(level):
+    """Set the level of the logger."""
+    if level.lower() not in LOG_OPTS:
+        __logger__.setLevel('INFO')
+        warning('Logger option {} not in options. Set to warning.')
+        return 'warning'
+    else:
+        __logger__.setLevel(level.upper())
+        return level
diff --git a/setup.py b/setup.py
index fdb65d3..5dd24b4 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,8 @@
 from setuptools import setup
 import versioneer
 
+with open('README.md') as readme:
+    longDesc = readme.read()
 
 classifiers = [
     'License :: OSI Approved :: MIT License',
@@ -23,6 +25,7 @@ setupArgs = {
     'url': 'https://github.com/CORE-GATECH-GROUP/serpent-tools',
     'description': ('A suite of parsers designed to make interacting with '
                     'SERPENT output files simple, scriptable, and flawless'),
+    'long_description': longDesc,
     'test_suite': 'serpentTools.tests',
     'author': 'Andrew Johnson',
     'author_email': 'ajohnson400@gatech.edu',

Feature: Implement a messaging and exception framework
Implement a overarching data logger that controls warnings, errors, and debug statements that allows the user to set the verbosity through the `rc` system. Maybe piggyback off of the [logging module](https://docs.python.org/3.6/library/logging.html)

Create a `SerpentToolsError` that is the base type for all critical errors thrown during operation.

## Usage
```from serpentTools.settings import rc
rc['verbosity'] = 'debug'
# print all status updates, errors, and debug statements
rc['definitely not a setting'] = 'still not good'
# raises SerpentToolsError or some subclass thereof
rc['verbosity'] = 'quiet'
# print only critical errors, same as `critical`
```
diff --git a/serpentTools/tests/test_loaders.py b/serpentTools/tests/test_loaders.py
index f6895e1..3bbd24e 100644
--- a/serpentTools/tests/test_loaders.py
+++ b/serpentTools/tests/test_loaders.py
@@ -57,7 +57,8 @@ class UserSettingsTester(unittest.TestCase):
             'metadataKeys': ['ZAI', 'NAMES', 'DAYS', 'BU'],
             'materialVariables': ['ADENS', 'MDENS', 'BURNUP'],
             'materials': [],
-            'processTotal': True
+            'processTotal': True,
+            'verbosity': 'warning'
         }
         actual = self.loader.getReaderSettings(readerName)
         self.assertDictEqual(expected, actual)

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest drewtils>=0.1.5
apt-get update apt-get install -y gcc
3.9
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
contourpy==1.3.0
cycler==0.12.1
drewtils==0.1.9
exceptiongroup==1.2.2
fonttools==4.56.0
importlib_resources==6.5.2
iniconfig==2.1.0
kiwisolver==1.4.7
matplotlib==3.9.4
numpy==2.0.2
packaging==24.2
pillow==11.1.0
pluggy==1.5.0
pyparsing==3.2.3
pytest==8.3.5
python-dateutil==2.9.0.post0
-e git+https://github.com/CORE-GATECH-GROUP/serpent-tools.git@4b93cd86c6149b94960984892dad25de6fbbb41f#egg=serpentTools
six==1.17.0
tomli==2.2.1
versioneer==0.29
zipp==3.21.0

name: serpent-tools
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
  - 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=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - contourpy==1.3.0
      - cycler==0.12.1
      - drewtils==0.1.9
      - exceptiongroup==1.2.2
      - fonttools==4.56.0
      - importlib-resources==6.5.2
      - iniconfig==2.1.0
      - kiwisolver==1.4.7
      - matplotlib==3.9.4
      - numpy==2.0.2
      - packaging==24.2
      - pillow==11.1.0
      - pluggy==1.5.0
      - pyparsing==3.2.3
      - pytest==8.3.5
      - python-dateutil==2.9.0.post0
      - six==1.17.0
      - tomli==2.2.1
      - versioneer==0.29
      - zipp==3.21.0
prefix: /opt/conda/envs/serpent-tools

serpentTools/tests/test_loaders.py::UserSettingsTester::test_returnReaderSettings
serpentTools/tests/test_loaders.py::DefaultSettingsTester::test_cannotChangeDefaults serpentTools/tests/test_loaders.py::DefaultSettingsTester::test_getDefault serpentTools/tests/test_loaders.py::UserSettingsTester::test_failAtBadSetting_options serpentTools/tests/test_loaders.py::UserSettingsTester::test_failAtBadSettings_type serpentTools/tests/test_loaders.py::UserSettingsTester::test_failAtNonexistentSetting serpentTools/tests/test_loaders.py::RCTester::test_readerWithUpdatedSettings
setup.py serpentTools/settings/__init__.py serpentTools/parsers/depletion.py serpentTools/__init__.py serpentTools/settings/messages.py
setup.py serpentTools/settings/__init__.py serpentTools/parsers/depletion.py serpentTools/__init__.py serpentTools/settings/messages.py