<data name="Word_At" xml:space="preserve">
<value>at</value>
</data>
- </root>
+ <data name="DebugAssertBanner" xml:space="preserve">
+ <value>---- DEBUG ASSERTION FAILED ----</value>
+ </data>
+ <data name="DebugAssertLongMessage" xml:space="preserve">
+ <value>---- Assert Long Message ----</value>
+ </data>
+ <data name="DebugAssertShortMessage" xml:space="preserve">
+ <value>---- Assert Short Message ----</value>
+ </data>
+</root>
<Compile Include="$(BclSourcesRoot)\System\Diagnostics\AssertFilter.cs" />
<Compile Include="$(BclSourcesRoot)\System\Diagnostics\AssertFilters.cs" />
<Compile Include="$(BclSourcesRoot)\System\Diagnostics\ConditionalAttribute.cs" />
+ <Compile Include="$(BclSourcesRoot)\System\Diagnostics\Debug.cs" />
+ <Compile Include="$(BclSourcesRoot)\System\Diagnostics\Debug.Unix.cs" Condition="'$(TargetsUnix)' == 'true'" />
+ <Compile Include="$(BclSourcesRoot)\System\Diagnostics\Debug.Windows.cs" Condition="'$(TargetsUnix)' != 'true'" />
+ <Compile Include="$(BclSourcesRoot)\Interop\Windows\kernel32\Interop.OutputDebugString.cs" Condition="'$(TargetsUnix)' != 'true'" />
<Compile Include="$(BclSourcesRoot)\System\Diagnostics\Debugger.cs" />
<Compile Include="$(BclSourcesRoot)\System\Diagnostics\DebuggerAttributes.cs" />
<Compile Include="$(BclSourcesRoot)\System\Diagnostics\ICustomDebuggerNotification.cs" />
<ItemGroup Condition="'$(TargetsUnix)' == 'true'">
<Compile Include="$(BclSourcesRoot)\System\HResults.cs" />
<Compile Include="$(BclSourcesRoot)\Interop\Unix\System.Native\Interop.GetRandomBytes.cs" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="$(BclSourcesRoot)\Debug.cs" />
+ <Compile Include="$(BclSourcesRoot)\Interop\Unix\System.Native\Interop.SysLog.cs" />
</ItemGroup>
<!-- Include additional sources shared files in the compilation -->
<ItemGroup>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System.Diagnostics;
-
-namespace System
-{
- internal static class Debug
- {
- [Conditional("_DEBUG")]
- static public void Assert(bool condition)
- {
- BCLDebug.Assert(condition);
- }
-
- [Conditional("_DEBUG")]
- static public void Assert(bool condition, string message)
- {
- BCLDebug.Assert(condition, message);
- }
-
- [Conditional("_DEBUG")]
- static public void Fail(string message)
- {
- BCLDebug.Assert(false, message);
- }
- }
-}
// See the LICENSE file in the project root for more information.
using System;
+using System.Diagnostics;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Security;
--- /dev/null
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Sys
+ {
+ internal enum SysLogPriority : int
+ {
+ // Priorities
+ LOG_EMERG = 0, /* system is unusable */
+ LOG_ALERT = 1, /* action must be taken immediately */
+ LOG_CRIT = 2, /* critical conditions */
+ LOG_ERR = 3, /* error conditions */
+ LOG_WARNING = 4, /* warning conditions */
+ LOG_NOTICE = 5, /* normal but significant condition */
+ LOG_INFO = 6, /* informational */
+ LOG_DEBUG = 7, /* debug-level messages */
+ // Facilities
+ LOG_KERN = (0<<3), /* kernel messages */
+ LOG_USER = (1<<3), /* random user-level messages */
+ LOG_MAIL = (2<<3), /* mail system */
+ LOG_DAEMON = (3<<3), /* system daemons */
+ LOG_AUTH = (4<<3), /* authorization messages */
+ LOG_SYSLOG = (5<<3), /* messages generated internally by syslogd */
+ LOG_LPR = (6<<3), /* line printer subsystem */
+ LOG_NEWS = (7<<3), /* network news subsystem */
+ LOG_UUCP = (8<<3), /* UUCP subsystem */
+ LOG_CRON = (9<<3), /* clock daemon */
+ LOG_AUTHPRIV = (10<<3), /* authorization messages (private) */
+ LOG_FTP = (11<<3), /* ftp daemon */
+ // Between FTP and Local is reserved for system use
+ LOG_LOCAL0 = (16<<3), /* reserved for local use */
+ LOG_LOCAL1 = (17<<3), /* reserved for local use */
+ LOG_LOCAL2 = (18<<3), /* reserved for local use */
+ LOG_LOCAL3 = (19<<3), /* reserved for local use */
+ LOG_LOCAL4 = (20<<3), /* reserved for local use */
+ LOG_LOCAL5 = (21<<3), /* reserved for local use */
+ LOG_LOCAL6 = (22<<3), /* reserved for local use */
+ LOG_LOCAL7 = (23<<3), /* reserved for local use */
+ }
+
+ /// <summary>
+ /// Write a message to the system logger, which in turn writes the message to the system console, log files, etc.
+ /// See man 3 syslog for more info
+ /// </summary>
+ /// <param name="priority">
+ /// The OR of a priority and facility in the SysLogPriority enum to declare the priority and facility of the log entry
+ /// </param>
+ /// <param name="message">The message to put in the log entry</param>
+ /// <param name="arg1">Like printf, the argument is passed to the variadic part of the C++ function to wildcards in the message</param>
+ [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SysLog")]
+ internal static extern void SysLog(SysLogPriority priority, string message, string arg1);
+ }
+}
using System.Collections;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Diagnostics.Contracts;
namespace System
int bufCount;
int i = 0;
- using (SafeFileHandle fileHandle = SafeFileHandleHelper.Open(() => Interop.Sys.Dup(Interop.Sys.FileDescriptors.STDERR_FILENO)))
+ while (i < message.Length)
{
- while (i < message.Length)
+ for (bufCount = 0; bufCount < BufferLength && i < message.Length; i++)
{
- for (bufCount = 0; bufCount < BufferLength && i < message.Length; i++)
+ if (message[i] <= 0x7F)
{
- if (message[i] <= 0x7F)
- {
- buf[bufCount] = (byte)message[i];
- bufCount++;
- }
+ buf[bufCount] = (byte)message[i];
+ bufCount++;
}
+ }
- int totalBytesWritten = 0;
- while (bufCount > 0)
+ int totalBytesWritten = 0;
+ while (bufCount > 0)
+ {
+ int bytesWritten = Interop.Sys.Write(2 /* stderr */, buf + totalBytesWritten, bufCount);
+ if (bytesWritten < 0)
{
- int bytesWritten = Interop.Sys.Write(fileHandle, buf + totalBytesWritten, bufCount);
- if (bytesWritten < 0)
- {
- // On error, simply stop writing the debug output. This could commonly happen if stderr
- // was piped to a program that ended before this program did, resulting in EPIPE errors.
- return;
- }
-
- bufCount -= bytesWritten;
- totalBytesWritten += bytesWritten;
+ // On error, simply stop writing the debug output. This could commonly happen if stderr
+ // was piped to a program that ended before this program did, resulting in EPIPE errors.
+ return;
}
+
+ bufCount -= bytesWritten;
+ totalBytesWritten += bytesWritten;
}
}
}
// See the LICENSE file in the project root for more information.
using System;
+using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using System.Diagnostics.Contracts;
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+using System.Diagnostics;
using System.Threading;
namespace System.Globalization
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+using System.Diagnostics;
+
#if ENABLE_WINRT
using Internal.Runtime.Augments;
#endif
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+using System.Diagnostics;
+
namespace System.Globalization
{
sealed partial class IdnMapping
// RFC 3491 - Nameprep: A Stringprep Profile for Internationalized Domain Names (IDN)
// RFC 3492 - Punycode: A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)
+using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.Text;
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
+using System.Diagnostics;
namespace System.Globalization
{
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+using System.Diagnostics;
+
namespace System.Reflection
{
public class LocalVariableInfo
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
+using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.Runtime.Serialization;
using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache;
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
+using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.Runtime.Serialization;
using System.Runtime.CompilerServices;
using System.Collections;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
+using System.Diagnostics;
using System.Diagnostics.Contracts;
namespace System
using System.Text;
using System.Threading;
using System.Collections;
+using System.Diagnostics;
using System.Globalization;
namespace System
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
+using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Security;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.Globalization;
using System.Runtime.Serialization;