forked from drewburlingame/ObjectPrinter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tabs to spaces, typos, set assembly version
- Loading branch information
Justin Greywolf
committed
May 19, 2021
1 parent
92cb2aa
commit 1fd7284
Showing
53 changed files
with
1,102 additions
and
1,075 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
using System.IO; | ||
using ObjectPrinter.Utilties; | ||
using ObjectPrinter.Utilities; | ||
using log4net.ObjectRenderer; | ||
|
||
namespace ObjectPrinter.Log4Net | ||
{ | ||
/// <summary> | ||
/// class used by log4net to render objects | ||
/// </summary> | ||
public class Log4NetObjectRenderer : IObjectRenderer | ||
{ | ||
/// <summary></summary> | ||
public void RenderObject(RendererMap rendererMap, object obj, TextWriter writer) | ||
{ | ||
if (obj == null) | ||
{ | ||
return; | ||
} | ||
public class Log4NetObjectRenderer : IObjectRenderer | ||
{ | ||
/// <summary></summary> | ||
public void RenderObject(RendererMap rendererMap, object obj, TextWriter writer) | ||
{ | ||
if (obj == null) | ||
{ | ||
return; | ||
} | ||
|
||
var objAsString = obj as string; | ||
if (obj is string) | ||
{ | ||
writer.Write(objAsString); | ||
return; | ||
} | ||
var objAsString = obj as string; | ||
if (obj is string) | ||
{ | ||
writer.Write(objAsString); | ||
return; | ||
} | ||
|
||
if (obj is LazyString) | ||
{ | ||
writer.Write(obj.ToString()); | ||
return; | ||
} | ||
if (obj is LazyString) | ||
{ | ||
writer.Write(obj.ToString()); | ||
return; | ||
} | ||
|
||
var ns = obj.GetType().Namespace; | ||
if (!string.IsNullOrEmpty(ns) && (ns.StartsWith("log4net") || ns.StartsWith("Common.Logging"))) | ||
{ | ||
//if we get a log4net object, log4net will expect us to call ToString to get the format | ||
writer.Write(obj.ToString()); | ||
return; | ||
} | ||
var ns = obj.GetType().Namespace; | ||
if (!string.IsNullOrEmpty(ns) && (ns.StartsWith("log4net") || ns.StartsWith("Common.Logging"))) | ||
{ | ||
//if we get a log4net object, log4net will expect us to call ToString to get the format | ||
writer.Write(obj.ToString()); | ||
return; | ||
} | ||
|
||
obj.DumpTo(writer); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.