Skip to content

Commit

Permalink
docs: added code documentation
Browse files Browse the repository at this point in the history
FossilOrigin-Name: b310487f9087c4d49a9bb9028d6d58f4579dbdf5cbb607d7521899a60463c896
  • Loading branch information
thindil committed Nov 3, 2023
1 parent 1f04fc5 commit 161d882
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/logger.nim
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

## This module contains code related to logging the shell debug messages to
## a file. The logging works only if the shell was build in the debug mode.
## a file. The logging works only if the shell was build in debug mode.

# External modules imports
import contracts
Expand All @@ -42,6 +42,10 @@ when defined(debug):

proc log*(message: string) {.sideEffect, raises: [], tags: [WriteIOEffect,
RootEffect], contractual.} =
## Log the selected message into a file. This procedure works only when
## the shell is compiled in debug mode.
##
## * message - the text which will be logged to a file
require:
message.len > 0
body:
Expand All @@ -54,6 +58,8 @@ proc log*(message: string) {.sideEffect, raises: [], tags: [WriteIOEffect,

proc startLogging*() {.sideEffect, raises: [], tags: [WriteIOEffect,
RootEffect], contractual.} =
## Start the logging system of the shell. This procedure works only when
## the shell is compiled in debug mode.
body:
when defined(debug):
try:
Expand Down

0 comments on commit 161d882

Please sign in to comment.