Skip to content

Commit 640b48e

Browse files
committed
Added documentation generation and additional XML comments
1 parent 1289808 commit 640b48e

File tree

7 files changed

+30
-2
lines changed

7 files changed

+30
-2
lines changed

CommonsLibrary.Logging/CommonsLibrary.Logging.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<RepositoryType>git</RepositoryType>
1919
<PackageTags>lib;library;c#;logging;logs</PackageTags>
2020
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
21+
<GenerateDocumentationFile>True</GenerateDocumentationFile>
2122
</PropertyGroup>
2223

2324
<ItemGroup>

CommonsLibrary.Logging/Log.cs

+22
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,21 @@
33

44
namespace CommonsLibrary.Logging
55
{
6+
/// <summary>
7+
/// Log container class
8+
/// </summary>
9+
/// <remarks>Depends on 'System' & 'System.IO' packages.</remarks>
610
public class Log
711
{
812
private readonly string _filePath;
913
private static Log? _logger;
1014

1115
private Log(string filePath) => _filePath = filePath;
16+
/// <summary>
17+
/// Singleton used to retrieve the active logger
18+
/// </summary>
19+
/// <param name="filePath">Full file path of the log file</param>
20+
/// <returns>Instance of the Log class</returns>
1221
public static Log GetLogger(string filePath) => _logger ??= new Log(filePath);
1322

1423
private void WriteLog(LogLevel level, string message, Exception? exception = null)
@@ -17,12 +26,25 @@ private void WriteLog(LogLevel level, string message, Exception? exception = nul
1726
writer.WriteLine($"{DateTime.Now} {level} {exception} {message}");
1827
}
1928

29+
/// <summary>
30+
/// Used to create Info level logs
31+
/// </summary>
32+
/// <param name="message">Message to be written</param>
2033
public void Info(string message) =>
2134
WriteLog(LogLevel.Info, message);
2235

36+
/// <summary>
37+
/// Used to create Warning level logs
38+
/// </summary>
39+
/// <param name="message">Message to be written</param>
2340
public void Warning(string message) =>
2441
WriteLog(LogLevel.Warning, message);
2542

43+
/// <summary>
44+
/// Used to create Error level logs
45+
/// </summary>
46+
/// <param name="message">Message to be written</param>
47+
/// <param name="exception">Exception to be logged</param>
2648
public void Error(string message, Exception exception) =>
2749
WriteLog(LogLevel.Error, message, exception);
2850

CommonsLibrary.Maths/CommonsLibrary.Maths.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
<RepositoryUrl>https://github.com/alex8obrien/CommonsLibrary</RepositoryUrl>
1515
<RepositoryType>git</RepositoryType>
1616
<PackageTags>lib;library;c#;math;maths</PackageTags>
17-
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
1817
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
18+
<GenerateDocumentationFile>True</GenerateDocumentationFile>
1919
</PropertyGroup>
2020

2121
<ItemGroup>

CommonsLibrary.Maths/Constants.cs

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
namespace CommonsLibrary.Maths
44
{
5+
/// <summary>
6+
/// Collection of mathematical constants
7+
/// </summary>
58
public static class Constants
69
{
710
public const decimal E = 2.71828182845904523536028747135266249775724709369995957496696762772407663035354759457138217852516642742746m;

CommonsLibrary.Maths/Converts.cs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ namespace CommonsLibrary.Maths
44
{
55
public static class Converts
66
{
7-
87
public static string UBinToOct(string input) => Convert.ToString(Convert.ToInt32(input, 2), 8);
98
public static int UBinToDec(string input) => Convert.ToInt32(input, 2);
109
public static string UBinToHex(string input) => Convert.ToInt32(input, 2).ToString("X");

CommonsLibrary/CommonsLibrary.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<PackageId>Alex.CommonsLibrary</PackageId>
1717
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1818
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
19+
<GenerateDocumentationFile>True</GenerateDocumentationFile>
1920
</PropertyGroup>
2021

2122
<ItemGroup>

CommonsLibrary/FileIO.cs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
namespace CommonsLibrary
55
{
6+
/// <summary>Static class containing useful file methods.</summary>
7+
/// <remarks>Requires the 'System.IO' package.</remarks>
68
public static class FileIO
79
{
810
/// <summary>Calculates the number of lines in a file.</summary>

0 commit comments

Comments
 (0)