Skip to content

XDeevv/CSLog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image image image

What is CSLog?

CSLog is a simple logging library for c# and other .net applications like visual basic. Its made using no third-party libraries. Its open source and completely free to use and modify

Download:

Instructions:

  • Download CSLog.dll
  • Make it a dependency in your project
  • Add using CSLog; on your main script
  • You can skip the first two parts if you download it from NuGet

img

Examples

Logging abilities

CSLogger.Log(Types.Debug, "Debug log");
CSLogger.Log(Types.Info, "Info log");
CSLogger.Log(Types.Warning, "Warning log");
CSLogger.Log(Types.Error, "Error log");
CSLogger.Log(Types.Critical, "Critical log");

Create custom logs

CSLCustom pattern = new CSLCustom("<FG=DarkGray>{Timestamp} <RS>[<FG={EX=3}>{EX=2}<RS>] | <BG={EX=1}><FG=Black>{EX=0}<RS> | : {Message}");
CSLogger.LogWithCustomProfile(pattern, "Custom log", "Server", "Blue", "Custom", "Magenta");
  • Use {Timestamp} and {Message} to define where the timestamp and the message goes
  • Add a , next to the title and then use {EX=number} to set the text it must start with a 0
  • Use the <BG=Color> and the <FG=Color> tag to define the log colors
  • You can also use the <RS> Tag to reset the colors

img

© 2023 XDev