You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
apphost-extract/src/apphost-extract/apphost-extract/Log.cs

62 lines
1.4 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
public static class Log
{
public static void Critical(object value)
{
Color(ConsoleColor.Magenta);
Console.WriteLine("[!] " + value.ToString());
Color();
}
public static void Info(object value)
{
Color(ConsoleColor.Cyan);
Console.WriteLine("[+] " + value.ToString());
}
public static bool QueryYesNo(string question)
{
var input = QueryString(question);
if (input.ToLower().StartsWith("y")) return true;
else return false;
}
public static string QueryString(string question)
{
Color(ConsoleColor.Yellow);
Console.Write("[?] " + question);
Color();
return Console.ReadLine();
}
public static void Info(object value, ConsoleColor color)
{
Color(color);
Console.WriteLine("[+] " + value.ToString());
}
public static void Error(object value)
{
Color(ConsoleColor.Red);
Console.WriteLine("[-] " + value.ToString());
Color();
}
public static void Fatal(object value)
{
Error(value);
Console.ReadLine();
Environment.Exit(0);
}
private static void Color(ConsoleColor color = ConsoleColor.White)
{
Console.ForegroundColor = color;
}
}