Skip to content

indiemini/LogMan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LogMan

LogMan is a lightweight .NET console solution, inspired by the interactive server consoles used in Minecraft servers like Spigot and Paper. It allows multiple threads to output text to the console, without breaking any input currently being typed by a user.

Demo - with LogMan :)

LogMan outputs text above your current input, like this:

Uninterrupted logging

Demo - w/ default Console.ReadLine()

Without LogMan, the server's info gets jumbled with your input. It's unusable: Without LogMan, this is a mess

Installation

LogMan is available as a NuGet package.

Usage

using LogManager;
using System;

class Program
{
    static void Main(string[] args)
    {
        LogMan.Info("Hello world!");

        string command;
        while ((command = LogMan.ReadLine()) != "stop")
        {
            // we got a line, let's handle it!
            HandleInput(command);
        }
    }

    static void HandleInput(string text)
    {
        // dummy code!
        if (text.StartsWith("hey logman!"))
            LogMan.Info("hey back!");
    }
}

License

MIT

About

a better way to do console stuff

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages