123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- #region Apache License
- #endregion
- #if !MONO
- #if !SSCLI
- #if !CLI_1_0
- using System.Runtime.InteropServices;
- using log4net.Layout;
- using log4net.Core;
- namespace log4net.Appender
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- public class OutputDebugStringAppender : AppenderSkeleton
- {
- #region Public Instance Constructors
-
-
-
-
-
-
-
-
- public OutputDebugStringAppender()
- {
- }
- #endregion // Public Instance Constructors
- #region Override implementation of AppenderSkeleton
-
-
-
-
-
-
-
-
-
- #if NET_4_0 || MONO_4_0 || NETSTANDARD1_3
- [System.Security.SecuritySafeCritical]
- #elif !NETCF
- [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, UnmanagedCode = true)]
- #endif
- override protected void Append(LoggingEvent loggingEvent)
- {
- #if NETSTANDARD1_3
- if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
- {
- throw new System.PlatformNotSupportedException("OutputDebugString is only available on Windows");
- }
- #endif
- OutputDebugString(RenderLoggingEvent(loggingEvent));
- }
-
-
-
-
-
-
-
-
-
- override protected bool RequiresLayout
- {
- get { return true; }
- }
- #endregion // Override implementation of AppenderSkeleton
- #region Protected Static Methods
-
-
-
-
-
-
-
-
-
- #if NETCF
- [DllImport("CoreDll.dll")]
- #else
- [DllImport("Kernel32.dll")]
- #endif
- protected static extern void OutputDebugString(string message);
- #endregion // Protected Static Methods
- }
- }
- #endif // !CLI_1_0
- #endif // !SSCLI
- #endif // !MONO
|