Skip to content

Commit

Permalink
docs: add documentation for logging and testing
Browse files Browse the repository at this point in the history
  • Loading branch information
DorielRivalet committed Apr 20, 2023
1 parent 86ed327 commit c06444b
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
- [Classes](./classes.md): displays the class structure of the software.
- [Libraries](./libraries.md): lists the libraries used in this project.
- [Palette](./palette.md): gives a list of RGB and hexadecimal color values with their corresponding labels that were used in the source code.
- [Logging](./logging.md): describes our structured logging implementation and goals.
- [Testing](./testing.md): explains our unit testing implementation and objectives.

## Type Hierarchy

Expand Down
2 changes: 1 addition & 1 deletion docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The following steps outline the process for releasing and deploying the software

### Releasifying and Deployment Steps

1. Switch to the release branch: Run `git checkout release` to switch to the release branch.
1. Run `git fetch` to check for the latest remote changes. Then switch to the release branch: Run `git checkout release` to switch to the release branch.
2. Pull the latest changes: Run `git pull origin release` to pull the latest changes from the remote release branch.
3. Make changes: Make the necessary changes to the software, and thoroughly test them in-game. Ideally, add unit tests to cover the changes and fix any new bugs with new commits.
4. Bump version: Update the version in the CurrentProgramVersion variable, following SemVer's specifications.
Expand Down
23 changes: 23 additions & 0 deletions docs/logging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Structured Logging

## Overview

Our software uses structured logging to provide a clear and concise record of events and operations that occur during runtime. To facilitate structured logging, we use [NLog](https://github.com/NLog/NLog), a free logging platform for .NET with rich log routing and management capabilities.

### Logging with NLog

We have implemented a labeling system to categorize log messages into three main categories:

- DATABASE OPERATION: Log messages related to database operations.
- FILE OPERATION: Log messages related to I/O operations.
- PROGRAM OPERATION: Log messages related to any other operations.

All logs are saved to a file called `logs.log`, which is located in the same directory as the program. In the event of a crash, crash logs will be created with information about the crash, including the date and time, in the file name.

### Goals

The main goals of our structured logging implementation are to:

- Provide clear and concise logs that facilitate debugging and issue resolution.
- Categorize logs into relevant categories to help identify the source of issues.
- Ensure logs are easily accessible and stored in a standardized format.
9 changes: 9 additions & 0 deletions docs/testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Unit Tests

## Overview

We use unit testing to ensure that our software performs as expected and to identify and address any issues or bugs before release. To facilitate unit testing, we use [xUnit](https://github.com/xunit/xunit), a free, open-source, community-focused unit testing tool for .NET.

### Goals

Our primary goal for unit testing is to achieve a code coverage of 90% or above. We use SonarCloud's shields icons to display the percentage of code coverage.

0 comments on commit c06444b

Please sign in to comment.