Logging: Add ClassName Parts for GetFullClassName
This commit is contained in:
parent
857c559e01
commit
5a7223cac0
@ -288,7 +288,7 @@ Public Class LogConfig
|
||||
''' <returns>The fully qualified class name</returns>
|
||||
''' <remarks>This method is very resource-intensive!</remarks>
|
||||
<DebuggerStepThrough()>
|
||||
Public Shared Function GetClassFullName(Optional IncludeMethodNames As Boolean = False) As String
|
||||
Public Shared Function GetClassFullName(Optional IncludeMethodNames As Boolean = False, Optional Parts As Integer = 0) As String
|
||||
Dim oFramesToSkip As Integer = 2
|
||||
Dim oClassName As String = String.Empty
|
||||
Dim oStackTrace = Environment.StackTrace
|
||||
@ -316,6 +316,16 @@ Public Class LogConfig
|
||||
End If
|
||||
Next
|
||||
|
||||
If Parts > 0 Then
|
||||
Dim oParts = oClassName.
|
||||
Split(".").
|
||||
Reverse().
|
||||
Take(Parts).
|
||||
Reverse()
|
||||
|
||||
oClassName = String.Join(".", oParts)
|
||||
End If
|
||||
|
||||
Return oClassName
|
||||
End Function
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user