Skip to content
Permalink
Browse files

Merge branch 'dev' of https://github.com/Orckestra/C1-CMS-Foundation

…into dev
  • Loading branch information...
mawtex committed Mar 14, 2019
2 parents 494190a + 9b7ef7c commit febc8ac0ea70e972c88fa13ef7cb26c03ba84bdb
Showing with 14 additions and 15 deletions.
  1. +14 −15 Composite/Core/Logging/LoggingService.cs
@@ -63,23 +63,23 @@ static private void LogEntry(string title, string message, Exception exc, Catego

static private void LogEntry(string title, string message, Exception exc, Category category, System.Diagnostics.TraceEventType severity, int priority, int eventid)
{
var entry = new Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry();

// TODO: refactor this code
entry.Title = string.Format("({0} - {1}) {2}", AppDomain.CurrentDomain.Id, Thread.CurrentThread.ManagedThreadId, title);
entry.Message = message;
entry.Severity = severity;
entry.Priority = priority;
entry.EventId = eventid;
var entry = new Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry
{
Title = $"({AppDomain.CurrentDomain.Id} - {Thread.CurrentThread.ManagedThreadId}) {title}",
Message = message,
Severity = severity,
Priority = priority,
EventId = eventid
};

if ((category & Category.General) != 0)
{
entry.Categories.Add("General");
entry.Categories.Add(nameof(Category.General));
}

if ((category & Category.Audit) != 0)
{
entry.Categories.Add("Audit");
entry.Categories.Add(nameof(Category.Audit));
}

if (exc != null)
@@ -259,11 +259,10 @@ private static void OnFlush(FlushEventArgs args)

static string PrettyExceptionCallStack(Exception ex)
{
string serializedException = ex.ToString();
if (ex == null) return "[exception is null]";

string cleanException;

if (ex.InnerException != null && ExcludeInnerExceptionInformation(ex, serializedException, out cleanException))
string serializedException = ex.ToString();
if (ex.InnerException != null && ExcludeInnerExceptionInformation(ex, serializedException, out var cleanException))
{
return PrettyExceptionCallStack(ex.InnerException) + Environment.NewLine + cleanException;
}
@@ -323,7 +322,7 @@ public static void Initialize(Resources resources)
}
else
{
string path = Path.Combine(PathUtil.BaseDirectory, string.Format("logging{0}.config", Guid.NewGuid()));
string path = Path.Combine(PathUtil.BaseDirectory, $"logging{Guid.NewGuid()}.config");

using (C1StreamWriter writer = new C1StreamWriter(path))
{

0 comments on commit febc8ac

Please sign in to comment.
You can’t perform that action at this time.