C# Class Zazzles.Log

Handle all interaction with the log file
Datei anzeigen Open project: FOGProject/zazzles

Public Methods

Method Description
Action ( string action ) : void
ActionFail ( ) : void

Log a colored [Fail]

ActionPass ( ) : void

Log a colored [Pass]

ActionResult ( bool success ) : void
Debug ( string caller, string message ) : void
Divider ( ) : void

Write a divider to the log

Entry ( Level level, string caller, string message ) : void

Entry a message

Entry ( string caller, string message ) : void

Entry a message

Error ( string caller, Exception ex ) : void
Error ( string caller, string message ) : void
Header ( string text ) : void

Write a header to the log

NewLine ( ) : void

Write a new line to the log

PaddedHeader ( string text ) : void

Create one header with a divider above and below it

UnhandledException ( object sender, UnhandledExceptionEventArgs ex ) : void
Write ( Level level, string text, ConsoleColor color = ConsoleColor.White ) : void

Write text to the log

Write ( string text, ConsoleColor color = ConsoleColor.White ) : void

Write text to the log

WriteLine ( Level level, string line, ConsoleColor color = ConsoleColor.White ) : void

Write a line to the log

WriteLine ( string line, ConsoleColor color = ConsoleColor.White ) : void

Write a line to the log

Private Methods

Method Description
CleanLog ( FileSystemInfo logFile ) : void

Wipe the log

Log ( ) : System
MessageToJSON ( string message ) : Newtonsoft.Json.Linq.JObject

Method Details

Action() public static method

public static Action ( string action ) : void
action string
return void

ActionFail() public static method

Log a colored [Fail]
public static ActionFail ( ) : void
return void

ActionPass() public static method

Log a colored [Pass]
public static ActionPass ( ) : void
return void

ActionResult() public static method

public static ActionResult ( bool success ) : void
success bool
return void

Debug() public static method

public static Debug ( string caller, string message ) : void
caller string
message string
return void

Divider() public static method

Write a divider to the log
public static Divider ( ) : void
return void

Entry() public static method

Entry a message
public static Entry ( Level level, string caller, string message ) : void
level Level The logging level
caller string The name of the calling method or class
message string The message to log
return void

Entry() public static method

Entry a message
public static Entry ( string caller, string message ) : void
caller string The name of the calling method or class
message string The message to log
return void

Error() public static method

public static Error ( string caller, Exception ex ) : void
caller string
ex System.Exception
return void

Error() public static method

public static Error ( string caller, string message ) : void
caller string
message string
return void

Header() public static method

Write a header to the log
public static Header ( string text ) : void
text string The text to put in the center of the header
return void

NewLine() public static method

Write a new line to the log
public static NewLine ( ) : void
return void

PaddedHeader() public static method

Create one header with a divider above and below it
public static PaddedHeader ( string text ) : void
text string The text to put in the center of the header
return void

UnhandledException() public static method

public static UnhandledException ( object sender, UnhandledExceptionEventArgs ex ) : void
sender object
ex System.UnhandledExceptionEventArgs
return void

Write() public static method

Write text to the log
public static Write ( Level level, string text, ConsoleColor color = ConsoleColor.White ) : void
level Level The logging level
text string The text to write
color ConsoleColor The color of the text if in Console mode, White will use the default color
return void

Write() public static method

Write text to the log
public static Write ( string text, ConsoleColor color = ConsoleColor.White ) : void
text string The text to write
color ConsoleColor The color of the text if in Console mode
return void

WriteLine() public static method

Write a line to the log
public static WriteLine ( Level level, string line, ConsoleColor color = ConsoleColor.White ) : void
level Level The logging level
line string The line to write
color ConsoleColor The color of the text if in Console mode
return void

WriteLine() public static method

Write a line to the log
public static WriteLine ( string line, ConsoleColor color = ConsoleColor.White ) : void
line string The line to write
color ConsoleColor The color of the text if in Console mode
return void