Skip to content

VladDen4/ColoredConsole

 
 

Repository files navigation

ColoredConsole

Build Test License Version

Just... Console with colors and animations for 'professional' style.

Preview

Readme-v1 0 6

You can find the source code from the preview here.

Usage

Download

You can download the library as a NuGet package from nuget.org, or download the latest source code and build the package yourself.

Methods


Writer.Log - Output logs to the console.

  • string text (required) - Text to display.
  • LogStatus color (default: LogStatus.Comment) - Text color. See colors in LogStatus.
  • bool newline (default: true) - Is a newline needed?
  • bool timestamp (default: true) - Is a timestamp needed?
  • bool toFile (default: true; recording will not be done without first calling the CreateLogFile method) - Do you need to write to a file?

Examples:

Writer.Log("Message");                            // [15:41:25] Message  | DarkGray
Writer.Log("Message", LogStatus.Warning);         // [15:41:25] Message  | Yellow
Writer.Log("Message", LogStatus.Default, false);  // [15:41:25] Message  | Gray, without newline (\n)
Writer.Log("Message", timestamp: false);          // Message             | DarkGray
Writer.Log("Message", toFile: false);             // [15:41:25] Message  | DarkGray, without logging to file

Writer.CreateLogfile - Required method to start writing logs to a file. Without it, there will be no writing to the file.

  • string directoryName (required) - Log folder name. Final path: .\logs\directoryName\yy.MM.dd-HH.mm.ss.log.

Examples:

Writer.CreateLogFile();               // Logs path: ".\logs\23.03.29-15:41:25.log"
Writer.CreateLogFile(@"");            // Logs path: ".\logs\23.03.29-15:41:25.log"
Writer.CreateLogFile(@"v1.0.6");      // Logs path: ".\logs\v1.0.6\23.03.29-15:41:25.log"
Writer.CreateLogFile(@"v1.0.7\beta"); // Logs path: ".\logs\v1.0.7\beta\23.03.29-15:41:25.log"
Writer.CreateLogFile(@"..\");         // Logs path: ".\23.03.29-15:41:25.log"

Repository

Issues

To report issues or suggest a new feature, please head over to the Issues page.

Contributions

For contributions, please open a Pull request.

License

ColoredConsole's code package is licensed under the MIT licence. Please see the licence file for more information. tl;dr you can do whatever you want as long as you include the original copyright and license notice in any copy of the software/source.

Languages

  • C# 100.0%