Skip to content

Commit

Permalink
fix: исправлена ошибка отображения данных пользователя
Browse files Browse the repository at this point in the history
  • Loading branch information
eafilatov authored and eafilatov committed Feb 5, 2024
1 parent 1f6d685 commit f48fb40
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/Data/LogMessage.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Text;
using System.Net.WebSockets;
using System.Reflection;
using System.Text;

using OkoloIt.Utilities.Logging.Configuration;

Expand All @@ -9,6 +11,8 @@ namespace OkoloIt.Utilities.Logging.Data;
/// </summary>
public sealed class LogMessage
{
private string _callerFile = string.Empty;

#region Internal Constructors

/// <summary>
Expand All @@ -30,7 +34,21 @@ internal LogMessage(LogLevel level, string message)
/// <summary>
/// Файл, в котором произошло обращение к логеру.
/// </summary>
internal string CallerFile { get; init; } = string.Empty;
internal string CallerFile {
get => _callerFile;
init {
string product = Assembly.GetExecutingAssembly()
.GetCustomAttributes(typeof(AssemblyProductAttribute), true)
.OfType<AssemblyProductAttribute>()
.FirstOrDefault()?.Product ?? string.Empty;

var productFolder = value.Split(Path.DirectorySeparatorChar)
.SkipWhile(d => d.Equals(product) == false)
.ToArray();

_callerFile = Path.Combine(productFolder);
}
}

/// <summary>
/// Строка, в которой произошло обращение к логеру.
Expand Down

0 comments on commit f48fb40

Please sign in to comment.