This repository has been archived by the owner on May 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
97 additions
and
16 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
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
|
||
namespace BlazorDB | ||
{ | ||
internal static class Logger | ||
{ | ||
internal static bool LogDebug { get; set; } = true; | ||
internal static readonly string blue = "color: blue; font-style: bold;"; | ||
internal static readonly string green = "color: green; font-style: bold;"; | ||
internal static readonly string red = "color: red; font-style: bold;"; | ||
internal static readonly string normal = "color: black; font-style: normal;"; | ||
|
||
internal static void StartContextType(Type contextType) | ||
{ | ||
if (!LogDebug) return; | ||
BlazorLogger.Logger.GroupCollapsed($"Context Loaded: %c{contextType.Namespace}.{contextType.Name}", blue); | ||
} | ||
|
||
internal static void EndContextType() | ||
{ | ||
if (!LogDebug) return; | ||
BlazorLogger.Logger.GroupEnd(); | ||
} | ||
|
||
internal static void ItemAddedToContext(string contextTypeName, Type modelType) | ||
{ | ||
if (!LogDebug) return; | ||
BlazorLogger.Logger.Log($"Item %c{modelType.Namespace}.{modelType.Name}%c %cadded%c to Context: %c{contextTypeName}", blue, normal, green, normal, blue); | ||
} | ||
|
||
internal static void LoadModelInContext(Type modelType) | ||
{ | ||
if (!LogDebug) return; | ||
BlazorLogger.Logger.Log($"StorageContext Loaded: %c{modelType.Namespace}.{modelType.Name}", blue); | ||
} | ||
|
||
internal static void ItemRemovedFromContext(string contextTypeName, Type modelType) | ||
{ | ||
if (!LogDebug) return; | ||
BlazorLogger.Logger.Log($"Item %c{modelType.Namespace}.{modelType.Name}%c %cremoved%c from Context: %c{contextTypeName}", blue, normal, red, normal, blue); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Reflection; | ||
|
||
namespace BlazorDB | ||
{ | ||
public class Options | ||
{ | ||
public Assembly Assembly { get; set; } | ||
public bool LogDebug { get; set; } | ||
} | ||
} |
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