You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devicemap.apache.org by wk...@apache.org on 2015/10/12 23:10:14 UTC
svn commit: r1708248 -
/devicemap/trunk/clients/1.0/vbnet/DeviceMap/Util/Util.vb
Author: wkeil
Date: Mon Oct 12 21:10:14 2015
New Revision: 1708248
URL: http://svn.apache.org/viewvc?rev=1708248&view=rev
Log:
DMAP-181: Release VB.net Client 1.0.1
Task-Url: https://issues.apache.org/jira/browse/DMAP-181
Modified:
devicemap/trunk/clients/1.0/vbnet/DeviceMap/Util/Util.vb
Modified: devicemap/trunk/clients/1.0/vbnet/DeviceMap/Util/Util.vb
URL: http://svn.apache.org/viewvc/devicemap/trunk/clients/1.0/vbnet/DeviceMap/Util/Util.vb?rev=1708248&r1=1708247&r2=1708248&view=diff
==============================================================================
--- devicemap/trunk/clients/1.0/vbnet/DeviceMap/Util/Util.vb (original)
+++ devicemap/trunk/clients/1.0/vbnet/DeviceMap/Util/Util.vb Mon Oct 12 21:10:14 2015
@@ -21,7 +21,8 @@ Imports System.Text
''' <summary>
''' Utilities
''' </summary>
-''' <author>eberhard speer jr.</author>
+''' <author>Eberhard Speer jr.</author>
+''' <author>Werner Keil</author>
''' <remarks>Apache's DeviceMap Project .Net version
''' ported from Reza Naghibi's Util.java</remarks>
Public NotInheritable Class Util
@@ -74,29 +75,29 @@ Public NotInheritable Class Util
Next
Return builder.ToString()
End Function
- ''' <summary>
- ''' Log Object to Application Log
- ''' </summary>
- ''' <param name="entryStr">String</param>
- ''' <param name="type">EventLogEntryType</param>
- ''' <remarks></remarks>
- Public Shared Sub WriteEntry(appName As String, entryStr As String, Optional type As EventLogEntryType = EventLogEntryType.Warning, Optional ex As Exception = Nothing)
- Using myLog As New Diagnostics.EventLog()
- myLog.Source = appName
- If Not Diagnostics.EventLog.SourceExists(myLog.Source) Then
- Diagnostics.EventLog.CreateEventSource(myLog.Source, "Application")
- End If
- If ex IsNot Nothing Then
- entryStr = String.Format("{0} : {1}", entryStr, ExceptionToString("ex", ex))
- End If
- Dim btText() As Byte = Encoding.UTF8.GetBytes(entryStr)
- If btText.Length > 32766 Then
- ' The message string is longer than 32766 bytes.
- entryStr = BitConverter.ToString(btText, 0, 32760)
- End If
- myLog.WriteEntry(entryStr, type)
- End Using
- End Sub
+ '' <summary>
+ '' Log Object to Application Log
+ '' </summary>
+ '' <param name="entryStr">String</param>
+ '' <param name="type">EventLogEntryType</param>
+ '' <remarks></remarks>
+ 'Public Shared Sub WriteEntry(appName As String, entryStr As String, Optional type As EventLogEntryType = EventLogEntryType.Warning, Optional ex As Exception = Nothing)
+ ' Using myLog As New Diagnostics.EventLog()
+ ' myLog.Source = appName
+ ' If Not Diagnostics.EventLog.SourceExists(myLog.Source) Then
+ ' Diagnostics.EventLog.CreateEventSource(myLog.Source, "Application")
+ ' End If
+ ' If ex IsNot Nothing Then
+ ' entryStr = String.Format("{0} : {1}", entryStr, ExceptionToString("ex", ex))
+ ' End If
+ ' Dim btText() As Byte = Encoding.UTF8.GetBytes(entryStr)
+ ' If btText.Length > 32766 Then
+ ' ' The message string is longer than 32766 bytes.
+ ' entryStr = BitConverter.ToString(btText, 0, 32760)
+ ' End If
+ ' myLog.WriteEntry(entryStr, type)
+ ' End Using
+ 'End Sub
''' <summary>
''' Exception to string
''' </summary>