Skip to main content

Class Console

The Log73 console.

Assembly: Log73.dll
View Source
Declaration
public static class Console

Properties

Out

Set to System.Console.Out by default.

View Source
Declaration
public static TextWriter Out { get; set; }

Err

Set to System.Console.Error by default.

View Source
Declaration
public static TextWriter Err { get; set; }

In

Set to System.Console.In by default.

View Source
Declaration
public static TextReader In { get; set; }

Title

View Source
Declaration
public static string Title { get; set; }

BufferHeight

View Source
Declaration
public static int BufferHeight { get; set; }

BufferWidth

View Source
Declaration
public static int BufferWidth { get; set; }

CapsLock

View Source
Declaration
public static bool CapsLock { get; }

CursorLeft

View Source
Declaration
public static int CursorLeft { get; set; }

CursorSize

View Source
Declaration
public static int CursorSize { get; set; }

CursorTop

View Source
Declaration
public static int CursorTop { get; set; }

CursorVisible

View Source
Declaration
public static bool CursorVisible { get; set; }

InputEncoding

View Source
Declaration
public static Encoding InputEncoding { get; set; }

KeyAvailable

View Source
Declaration
public static bool KeyAvailable { get; }

NumberLock

View Source
Declaration
public static bool NumberLock { get; }

OutputEncoding

View Source
Declaration
public static Encoding OutputEncoding { get; set; }

WindowHeight

View Source
Declaration
public static int WindowHeight { get; set; }

WindowLeft

View Source
Declaration
public static int WindowLeft { get; set; }

WindowTop

View Source
Declaration
public static int WindowTop { get; set; }

WindowWidth

View Source
Declaration
public static int WindowWidth { get; set; }

IsErrorRedirected

View Source
Declaration
public static bool IsErrorRedirected { get; }

IsInputRedirected

View Source
Declaration
public static bool IsInputRedirected { get; }

IsOutputRedirected

View Source
Declaration
public static bool IsOutputRedirected { get; }

LargerWindowHeight

View Source
Declaration
public static int LargerWindowHeight { get; }

LargerWindowWidth

View Source
Declaration
public static int LargerWindowWidth { get; }

TreatControlCAsInput

View Source
Declaration
public static bool TreatControlCAsInput { get; set; }

Fields

Options

View Source
Declaration
public static Log73Options Options

Object

View Source
Declaration
public static readonly ConsoleLogObject Object

Configure

View Source
Declaration
public static readonly ConsoleConfigureObject Configure

Methods

AtBottomLog(String, Boolean)

Keeps <code data-dev-comment-type="paramref" class="paramref">str</code> at the bottom of your console.

View Source
Declaration
public static void AtBottomLog(string str, bool clearPrevious = false)
Parameters
TypeNameDescription
System.StringstrThe string to keep at the bottom of your console. Less than the width of your console.
System.BooleanclearPreviousIf you want to overwrite the previous bottom message.

WriteLine(Object)

Logs the <code data-dev-comment-type="paramref" class="paramref">value</code> using the Log73.MessageTypes.Info Log73.MessageType.

View Source
Declaration
public static void WriteLine(object value)
Parameters
TypeName
System.Objectvalue

WriteLine()

Logs a newline.

View Source
Declaration
public static void WriteLine()

Write(Object)

View Source
Declaration
public static void Write(object value)
Parameters
TypeName
System.Objectvalue

Info(Object)

Logs the <code data-dev-comment-type="paramref" class="paramref">value</code> using the Log73.MessageTypes.Info Log73.MessageType.

View Source
Declaration
public static void Info(object value)
Parameters
TypeName
System.Objectvalue

Warn(Object)

Logs the <code data-dev-comment-type="paramref" class="paramref">value</code> using the Log73.MessageTypes.Warn Log73.MessageType.

View Source
Declaration
public static void Warn(object value)
Parameters
TypeName
System.Objectvalue

Error(Object)

Logs the <code data-dev-comment-type="paramref" class="paramref">value</code> using the Log73.MessageTypes.Error Log73.MessageType.

View Source
Declaration
public static void Error(object value)
Parameters
TypeName
System.Objectvalue

Debug(Object)

Logs the <code data-dev-comment-type="paramref" class="paramref">value</code> using the Log73.MessageTypes.Debug Log73.MessageType.

View Source
Declaration
public static void Debug(object value)
Parameters
TypeName
System.Objectvalue

Task(String, Task)

Log a System.Threading.Tasks.Task's start and failing or finishing.

View Source
Declaration
public static void Task(string name, Task task)
Parameters
TypeName
System.Stringname
System.Threading.Tasks.Tasktask

Log(Object)

View Source
Declaration
public static void Log(object value)
Parameters
TypeName
System.Objectvalue

Log(LogType, Object)

View Source
Declaration
public static void Log(LogType logType, object value)
Parameters
TypeName
Log73.LogTypelogType
System.Objectvalue

Log(MessageType, Object, LogInfoContext)

View Source
Declaration
public static void Log(MessageType msgType, object value, LogInfoContext context = null)
Parameters
TypeName
Log73.MessageTypemsgType
System.Objectvalue
Log73.LogInfoContextcontext

Exception(Exception)

Logs an exception with Log73.MessageTypes.Error with it's StackTrace if it isn't null.

View Source
Declaration
public static void Exception(Exception exception)
Parameters
TypeName
System.Exceptionexception

StopwatchTask(Func<Task>, Action<Int64>)

Invokes <code data-dev-comment-type="paramref" class="paramref">finished</code> after the Log73.Console.Task(System.String%2cSystem.Threading.Tasks.Task) returned by <code data-dev-comment-type="paramref" class="paramref">code</code> has finished.

View Source
Declaration
public static async Task StopwatchTask(Func<Task> code, Action<long> finished)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.Func&lt;System.Threading.Tasks.Task&gt;codeThe to be timed.
System.Action&lt;System.Int64&gt;finished

SetCursorPosition((Int32 left, Int32 top))

View Source
Declaration
public static void SetCursorPosition((int left, int top) position)
Parameters
TypeName
System.ValueTuple&lt;System.Int32,System.Int32&gt;position

ClearLastLine()

View Source
Declaration
public static void ClearLastLine()

Beep()

View Source
Declaration
public static void Beep()

Beep(Int32, Int32)

View Source
Declaration
public static void Beep(int frequency, int duration)
Parameters
TypeName
System.Int32frequency
System.Int32duration

Clear()

View Source
Declaration
public static void Clear()

SetWindowSize(Int32, Int32)

View Source
Declaration
public static void SetWindowSize(int width, int height)
Parameters
TypeName
System.Int32width
System.Int32height

SetCursorPosition(Int32, Int32)

View Source
Declaration
public static void SetCursorPosition(int left, int top)
Parameters
TypeName
System.Int32left
System.Int32top

SetBufferSize(Int32, Int32)

View Source
Declaration
public static void SetBufferSize(int width, int height)
Parameters
TypeName
System.Int32width
System.Int32height

ResetColor()

View Source
Declaration
public static void ResetColor()

Read()

View Source
Declaration
public static int Read()
Returns

System.Int32

ReadLine()

View Source
Declaration
public static string ReadLine()
Returns

System.String

GetCursorPosition()

View Source
Declaration
public static (int Left, int Top) GetCursorPosition()
Returns

System.ValueTuple{System.Int32,System.Int32}

SetIn(TextReader)

View Source
Declaration
public static void SetIn(TextReader textReader)
Parameters
TypeName
System.IO.TextReadertextReader

SetOut(TextWriter)

View Source
Declaration
public static void SetOut(TextWriter textWriter)
Parameters
TypeName
System.IO.TextWritertextWriter

SetError(TextWriter)

View Source
Declaration
public static void SetError(TextWriter textWriter)
Parameters
TypeName
System.IO.TextWritertextWriter

Events

CancelKeyPress

View Source
Declaration
public static event ConsoleCancelEventHandler CancelKeyPress
Event Type

System.ConsoleCancelEventHandler