' Collection of code snippets by Arne Vajhøj 
' (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
﻿Imports System

Imports NLog

Namespace Logging.NLog
    Public Class Test
        Private Shared ReadOnly log As Logger = LogManager.GetCurrentClassLogger()
        Public Shared Function Fac(n As Integer) As Integer
            Dim res As Integer
            If n <= 1 Then
                res = 1
            Else
                res = n * Fac(n - 1)
            End If
            If log.IsDebugEnabled Then
                log.Debug("fac : n = " & n & " res = " & res)
            End If
            Return res
        End Function
        Public Shared Sub Main(args As String())
            log.Info("Start")
            Console.WriteLine(Fac(50))
            log.Info("End")
        End Sub
    End Class
End Namespace
