Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions 2 src/NLog/Common/LogEventInfoBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@
namespace NLog.Common
{
using System;
using System.ComponentModel;

/// <summary>
/// A cyclic buffer of <see cref="LogEventInfo"/> object.
/// </summary>
[Obsolete("Use AsyncRequestQueue instead. Marked obsolete on NLog 5.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
public class LogEventInfoBuffer
{
private readonly object _lockObject = new object();
Expand Down
2 changes: 2 additions & 0 deletions 2 src/NLog/Config/INamedItemFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
namespace NLog.Config
{
using System;
using System.ComponentModel;

/// <summary>
/// Obsolete since dynamic type loading is not compatible with publish as trimmed application. Replaced by <see cref="IFactory{TBaseType}"/>.
Expand All @@ -42,6 +43,7 @@ namespace NLog.Config
/// <typeparam name="TInstanceType">Base type for each item instance.</typeparam>
/// <typeparam name="TDefinitionType">Item definition type (typically <see cref="System.Type"/>).</typeparam>
[Obsolete("Instead use NLog.LogManager.Setup().SetupExtensions(). Marked obsolete with NLog v5.2")]
[EditorBrowsable(EditorBrowsableState.Never)]
public interface INamedItemFactory<TInstanceType, TDefinitionType>
where TInstanceType : class
{
Expand Down
2 changes: 2 additions & 0 deletions 2 src/NLog/Config/LoggingConfigurationReloadedEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@
namespace NLog.Config
{
using System;
using System.ComponentModel;

/// <summary>
/// Obsolete and replaced by <see cref="LoggingConfigurationChangedEventArgs"/> and <see cref="LogFactory.ConfigurationChanged"/> with NLog v5.2.
/// </summary>
[Obsolete("Replaced by ConfigurationChanged, but check args.ActivatedConfiguration != null. Marked obsolete on NLog 5.2")]
[EditorBrowsable(EditorBrowsableState.Never)]
public class LoggingConfigurationReloadedEventArgs : EventArgs
{
/// <summary>
Expand Down
8 changes: 8 additions & 0 deletions 8 src/NLog/Config/SimpleConfigurator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
namespace NLog.Config
{
using System;
using System.ComponentModel;
using NLog.Internal;
using NLog.Targets;

Expand All @@ -45,6 +46,7 @@ namespace NLog.Config
/// Warning, these methods will overwrite the current config.
/// </summary>
[Obsolete("Use LogManager.Setup().LoadConfiguration() instead. Marked obsolete on NLog 5.2")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static class SimpleConfigurator
{
#if !NETSTANDARD1_3
Expand All @@ -55,6 +57,7 @@ public static class SimpleConfigurator
/// the <see cref="NLog.LogLevel.Info"/> level are output to the console.
/// </summary>
[Obsolete("Use LogManager.Setup().LoadConfiguration(c => c.ForLogger().WriteToConsole()) instead. Marked obsolete on NLog 5.2")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static void ConfigureForConsoleLogging()
{
ConfigureForConsoleLogging(LogLevel.Info);
Expand All @@ -68,6 +71,7 @@ public static void ConfigureForConsoleLogging()
/// </summary>
/// <param name="minLevel">The minimal logging level.</param>
[Obsolete("Use LogManager.Setup().LoadConfiguration(c => c.ForLogger(minLevel).WriteToConsole()) instead. Marked obsolete on NLog 5.2")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static void ConfigureForConsoleLogging(LogLevel minLevel)
{
ConsoleTarget consoleTarget = new ConsoleTarget();
Expand All @@ -86,6 +90,7 @@ public static void ConfigureForConsoleLogging(LogLevel minLevel)
/// </summary>
/// <param name="target">The target to log all messages to.</param>
[Obsolete("Use LogManager.Setup().LoadConfiguration(c => c.ForLogger().WriteTo(target)) instead. Marked obsolete on NLog 5.2")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static void ConfigureForTargetLogging(Target target)
{
Guard.ThrowIfNull(target);
Expand All @@ -101,6 +106,7 @@ public static void ConfigureForTargetLogging(Target target)
/// <param name="target">The target to log all messages to.</param>
/// <param name="minLevel">The minimal logging level.</param>
[Obsolete("Use LogManager.Setup().LoadConfiguration(c => c.ForLogger(minLevel).WriteTo(target)) instead. Marked obsolete on NLog 5.2")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static void ConfigureForTargetLogging(Target target, LogLevel minLevel)
{
Guard.ThrowIfNull(target);
Expand All @@ -117,6 +123,7 @@ public static void ConfigureForTargetLogging(Target target, LogLevel minLevel)
/// </summary>
/// <param name="fileName">Log file name.</param>
[Obsolete("Use LogManager.Setup().LoadConfiguration(c => c.ForLogger().WriteToFile(fileName)) instead. Marked obsolete on NLog 5.2")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static void ConfigureForFileLogging(string fileName)
{
ConfigureForFileLogging(fileName, LogLevel.Info);
Expand All @@ -131,6 +138,7 @@ public static void ConfigureForFileLogging(string fileName)
/// <param name="fileName">Log file name.</param>
/// <param name="minLevel">The minimal logging level.</param>
[Obsolete("Use LogManager.Setup().LoadConfiguration(c => c.ForLogger(minLevel).WriteToFile(fileName)) instead. Marked obsolete on NLog 5.2")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static void ConfigureForFileLogging(string fileName, LogLevel minLevel)
{
FileTarget target = new FileTarget();
Expand Down
2 changes: 2 additions & 0 deletions 2 src/NLog/Config/ThreadSafeAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
namespace NLog.Config
{
using System;
using System.ComponentModel;

/// <summary>
/// Marks the layout or layout renderer as thread safe - it producing correct results
Expand All @@ -43,6 +44,7 @@ namespace NLog.Config
/// </summary>
[Obsolete("All LayoutRenderer's and Layout's should be ThreadSafe by default. Marked obsolete with NLog 5.0")]
[AttributeUsage(AttributeTargets.Class)]
[EditorBrowsable(EditorBrowsableState.Never)]
public sealed class ThreadSafeAttribute : Attribute
{
}
Expand Down
11 changes: 11 additions & 0 deletions 11 src/NLog/Fluent/Log.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,16 @@
namespace NLog.Fluent
{
using System;
using System.ComponentModel;
using System.IO;
using System.Runtime.CompilerServices;
using NLog.Common;

/// <summary>
/// A global logging class using caller info to find the logger.
/// </summary>
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.3")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static class Log
{
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.0")]
Expand All @@ -57,6 +60,7 @@ public static class Log
/// <param name="callerFilePath">The full path of the source file that contains the caller. This is the file path at the time of compile.</param>
/// <returns>An instance of the fluent <see cref="LogBuilder"/>.</returns>
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Level(LogLevel logLevel, [CallerFilePath]string callerFilePath = null)
{
return Create(logLevel, callerFilePath);
Expand All @@ -70,6 +74,7 @@ public static LogBuilder Level(LogLevel logLevel, [CallerFilePath]string callerF
/// <param name="callerFilePath">The full path of the source file that contains the caller. This is the file path at the time of compile.</param>
/// <returns>An instance of the fluent <see cref="LogBuilder"/>.</returns>
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Trace([CallerFilePath]string callerFilePath = null)
{
return Create(LogLevel.Trace, callerFilePath);
Expand All @@ -83,6 +88,7 @@ public static LogBuilder Trace([CallerFilePath]string callerFilePath = null)
/// <param name="callerFilePath">The full path of the source file that contains the caller. This is the file path at the time of compile.</param>
/// <returns>An instance of the fluent <see cref="LogBuilder"/>.</returns>
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Debug([CallerFilePath]string callerFilePath = null)
{
return Create(LogLevel.Debug, callerFilePath);
Expand All @@ -96,6 +102,7 @@ public static LogBuilder Debug([CallerFilePath]string callerFilePath = null)
/// <param name="callerFilePath">The full path of the source file that contains the caller. This is the file path at the time of compile.</param>
/// <returns>An instance of the fluent <see cref="LogBuilder"/>.</returns>
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Info([CallerFilePath]string callerFilePath = null)
{
return Create(LogLevel.Info, callerFilePath);
Expand All @@ -109,6 +116,7 @@ public static LogBuilder Info([CallerFilePath]string callerFilePath = null)
/// <param name="callerFilePath">The full path of the source file that contains the caller. This is the file path at the time of compile.</param>
/// <returns>An instance of the fluent <see cref="LogBuilder"/>.</returns>
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Warn([CallerFilePath]string callerFilePath = null)
{
return Create(LogLevel.Warn, callerFilePath);
Expand All @@ -122,6 +130,7 @@ public static LogBuilder Warn([CallerFilePath]string callerFilePath = null)
/// <param name="callerFilePath">The full path of the source file that contains the caller. This is the file path at the time of compile.</param>
/// <returns>An instance of the fluent <see cref="LogBuilder"/>.</returns>
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Error([CallerFilePath]string callerFilePath = null)
{
return Create(LogLevel.Error, callerFilePath);
Expand All @@ -135,12 +144,14 @@ public static LogBuilder Error([CallerFilePath]string callerFilePath = null)
/// <param name="callerFilePath">The full path of the source file that contains the caller. This is the file path at the time of compile.</param>
/// <returns>An instance of the fluent <see cref="LogBuilder"/>.</returns>
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Fatal([CallerFilePath]string callerFilePath = null)
{
return Create(LogLevel.Fatal, callerFilePath);
}

[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
private static LogBuilder Create(LogLevel logLevel, string callerFilePath)
{
var logger = GetLogger(callerFilePath);
Expand Down
1 change: 1 addition & 0 deletions 1 src/NLog/Fluent/LogBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ namespace NLog.Fluent
/// A fluent class to build log events for NLog.
/// </summary>
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
public class LogBuilder
{
private readonly LogEventInfo _logEvent;
Expand Down
8 changes: 8 additions & 0 deletions 8 src/NLog/Fluent/LoggerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
// THE POSSIBILITY OF SUCH DAMAGE.
//
using System;
using System.ComponentModel;

namespace NLog.Fluent
{
Expand All @@ -49,6 +50,7 @@ public static class LoggerExtensions
/// <returns>current <see cref="LogBuilder"/> for chaining calls.</returns>
[CLSCompliant(false)]
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Log(this ILogger logger, LogLevel logLevel)
{
var builder = new LogBuilder(logger, logLevel);
Expand All @@ -64,6 +66,7 @@ public static LogBuilder Log(this ILogger logger, LogLevel logLevel)
/// <returns>current <see cref="LogBuilder"/> for chaining calls.</returns>
[CLSCompliant(false)]
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForTraceEvent() and LogEventBuilder. Obsoleted in NLog 5.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Trace(this ILogger logger)
{
var builder = new LogBuilder(logger, LogLevel.Trace);
Expand All @@ -79,6 +82,7 @@ public static LogBuilder Trace(this ILogger logger)
/// <returns>current <see cref="LogBuilder"/> for chaining calls.</returns>
[CLSCompliant(false)]
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForDebugEvent() and LogEventBuilder. Obsoleted in NLog 5.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Debug(this ILogger logger)
{
var builder = new LogBuilder(logger, LogLevel.Debug);
Expand All @@ -94,6 +98,7 @@ public static LogBuilder Debug(this ILogger logger)
/// <returns>current <see cref="LogBuilder"/> for chaining calls.</returns>
[CLSCompliant(false)]
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForInfoEvent() and LogEventBuilder. Obsoleted in NLog 5.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Info(this ILogger logger)
{
var builder = new LogBuilder(logger, LogLevel.Info);
Expand All @@ -109,6 +114,7 @@ public static LogBuilder Info(this ILogger logger)
/// <returns>current <see cref="LogBuilder"/> for chaining calls.</returns>
[CLSCompliant(false)]
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForWarnEvent() and LogEventBuilder. Obsoleted in NLog 5.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Warn(this ILogger logger)
{
var builder = new LogBuilder(logger, LogLevel.Warn);
Expand All @@ -124,6 +130,7 @@ public static LogBuilder Warn(this ILogger logger)
/// <returns>current <see cref="LogBuilder"/> for chaining calls.</returns>
[CLSCompliant(false)]
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForErrorEvent() and LogEventBuilder. Obsoleted in NLog 5.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Error(this ILogger logger)
{
var builder = new LogBuilder(logger, LogLevel.Error);
Expand All @@ -139,6 +146,7 @@ public static LogBuilder Error(this ILogger logger)
/// <returns>current <see cref="LogBuilder"/> for chaining calls.</returns>
[CLSCompliant(false)]
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForFatalEvent() and LogEventBuilder. Obsoleted in NLog 5.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Fatal(this ILogger logger)
{
var builder = new LogBuilder(logger, LogLevel.Fatal);
Expand Down
2 changes: 2 additions & 0 deletions 2 src/NLog/Internal/Abstractions/IAppDomain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ namespace NLog.Internal.Fakeables
using System;
using System.Reflection;
using System.Collections.Generic;
using System.ComponentModel;

/// <summary>
/// Interface for fakeable of the current AppDomain.
/// </summary>
[Obsolete("For unit testing only. Marked obsolete on NLog 5.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
public interface IAppDomain
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
namespace NLog.LayoutRenderers
{
using System;
using System.ComponentModel;
using System.Text;
using NLog.Config;
using NLog.Internal;
Expand Down Expand Up @@ -70,6 +71,7 @@ public sealed class AppSettingLayoutRenderer : LayoutRenderer, IStringValueRende
/// The AppSetting item-name
///</summary>
[Obsolete("Allows easier conversion from NLog.Extended. Instead use Item-property. Marked obsolete in NLog 4.6")]
[EditorBrowsable(EditorBrowsableState.Never)]
public string Name { get => Item; set => Item = value; }

///<summary>
Expand Down
1 change: 1 addition & 0 deletions 1 src/NLog/LogFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,7 @@ internal Logger CreateNewLogger(Type loggerType, Func<Type, Logger> loggerCreato
/// <param name="configFile">Configuration file to be read</param>
/// <returns>LogFactory instance for fluent interface</returns>
[Obsolete("Replaced by LogFactory.Setup().LoadConfigurationFromFile(). Marked obsolete on NLog 5.2")]
[EditorBrowsable(EditorBrowsableState.Never)]
public LogFactory LoadConfiguration(string configFile)
{
// TODO Remove explicit File-loading logic from LogFactory (Should handle environment without files)
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.