Added new documentation regarding the process of conducting new unit
tests for the project. Documentation covers what libraries are used in
test-driven development, along with how they are used.
Documentation covers how to create new unit tests according to a defined
standard, as well as using pytest fixtures.
Completed a README file containing a description of what the project is
and how it works. Along with examples on how to use the library, reasons
to use the project, and how it compares to built-in libraries.
Changed module in accordance to results of pytest unit testing.
`__DEFAULT_OUT_FILE` now converts a file spec into a real pathspec to
the system. This is now considered a constant default attribute.
New attribute `__default_out_file` to take the value of
`__DEFAULT_OUT_FILE` on initial class initialisation. However, this
attribute may be changed on a new class construction, and is used by the
class itself as the default output to file when logging.
Attribute `log` is reflective of `__default_out_file` and CANNOT be
changed by the user to affect class instance, making it Read-Only.
Added new public method `new`, which can reinitialise the
Singleton instance to change the default logging file. Note, once an
instance is created, the output file cannot be changed unless `new` is
invoked with a new file pathspec. This is to guarantee integrity of
logging output to a single file, unless otherwise required.
Class modifications to address changes listed above and bug fixes
identified from unit testing.
Added files which hold unit tests for each package component
respectfully. Unit testing makes use of the pytest library.
Majority of tests are self-explanatory, with wordy function headers to
help understand the purpose of the test. Note, test modules DO NOT
provide best practices and are separate from the standards set for the
remaining code base. For this reason, mypy and flake8 are told to ignore
testing modules.
pytest-cov is used to gain an idea of how much of the code base is being
reached by the unit tests. Coverage does not have to be 100%, and 100%
coverage does not indicate "bug-free" code. If any bugs are identified,
or further unit tests are possible to increase code base coverage,
create a new Issue, or PR request with the appropriate changes.
File contains a fixture which must be present for test_logger module to
work functionally. Fixture relates to a monkeypatch implementation for
capturing standard PIPEs and storing their results in a buffer. This
buffer can then be read after a call to send data on a PIPE stream has
been called, via a key lookup on the appropriate stream.
The committed files define the requirements and information related to
clog when packaging the module into a library.
setup.py instantiates the build script process used by pip in editor
mode, with the support of setup.cfg. File uses traditional build
approach using the setuptools library.
All files related to the clog package have been moved into the directory
space "clog/" to separate project repository from package itself, and
allows for the building of the package tool via pip.
Added a __version__.py file to contain all important attributes about
the package.
Added docstrings to module functions and classes, explaining purpose and
function of the function/class. Outline the parameters and return types.
`is_path_spec` renamed to use snake_case. Constants also made globally
to the module.
Module given docstrings to explain the purpose and function of defined
module functions. Giving parameter and return values of functions.
Module now contains `gen_log_header` moved from the `Logger` class,
along with global constants for the function.
Module given docstrings to extensively explain the purpose and function
of defined methods within the class, and class structure itself.
Method `genLogHeader` has been moved to `printfmt` module and renamed
`gen_log_header`, along with appropriate private attributes now global
constants in the module.
This commit is a continuation from commit [3746b773f4] which is a
separation of library modules into its own package from a larger
project.
Version control jump is significant in feature implementations due
simply to under-using commit control after minor feature
implementations. Project will receive better commit messages going
forward on changes to the package.