Colorful Logger Lib
No reviews yet
This library is designed to simplify a specific aspect of Minecraft Modding workflows by making it easy to add ANSI color to your Logger calls.
Provides a framework or library for other mods to use.
Fabric is a mod loader for versions 1.14+ of Minecraft, particularly popular for client side and optimization mods.
Community voices
Reviews
Click once to include, again to exclude, again to clear
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
Compatibility
Supported Environments
The author has not specified where this runs.
About
Project Details
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
About
Description

Ever wanted to add some color to your LOGGER during the development of your minecraft mods in a simple, yet functional manner?
Well look no further, Handsome Steve has you covered! This simple library allows you to do just that by utilizing a wide range of pre-defined ANSI codes.
EDIT: Please prioritize the Handsome Steve Maven as this also serves the Jar's Sources file. Alternatively, the installation code below has been updated to reflect Modrinth Maven incase the maven is ever offline, apologies in for any inconveniences.
FAQ
Q: Is this a mod?
Techinally, no. This is a library, so it's only really used when developing a mod, however, it may be required as a dependency when the dependent mod is being installed on a client/server depending on what platform the dependent mod is targeting and how the mod developer is utilising the library.
Q: Can I use this library as a dependency in my project?
Absolutely, go nuts!
Q: Does this library require a specific Fabric Version?
Nope, it's now standalone, so as long as your modding platform uses org.slf4j.Logger, it will work regardless of the version.
Current Version
Please note that the current version only has the Logger.info() method colorized, the rest will be added in future updates, such as Logger.error() etc.
Installation
Add the required Maven Repositories to your build.gradle in the repositories section:
repositories {
// Initial Maven Repository
// Priority
exclusiveContent {
forRepository {
maven {
name = "Handsome Steve's Maven"
url = "https://maven.handsomesteve.net/releases"
}
}
filter {
includeGroup "net.handsomesteve"
}
}
// Modrinth Fallback Maven
// Optional, but strongly recommended
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
filter {
includeGroup "maven.modrinth"
}
}
}
Add an implementation to your build.gradle in the dependencies section:
dependencies {
//Handsome Steve's Colorful Logger // This automatically downloads the sources file as well.
implementation include("net.handsomesteve:colorfulloggerlib:${project.hs_colorful_logger}")
// Modrinth Fallback (De-comment if preferred maven is down).
//implementation include ("maven.modrinth:colorfulloggerlib:${project.hs_colorful_logger}")
// SOURCES FILE NEEDS MANUAL DOWNLOAD, SEE BOTTOM OF PAGE (if using fallback maven).
}
Add the version variable to your gradle.properties and replace {version} by the desired available library version of your choice:
hs_colorful_logger={version}
Implementation
Create a public static final instance of the ColorfulLogger class. This instance will allow you to utilize the internal reference of org.slf4j.Logger from the ColorfulLogger class throughout your project.
import net.handsomesteve.api.ColorfulLogger;
import net.handsomesteve.api.ansi.AnsiColorBackground;
import net.handsomesteve.api.ansi.AnsiColorText;
public class FabricMod implements ModInitializer {
public static final String MOD_ID = "your-mod-id";
public static final ColorfulLogger LOGGER = ColorfulLogger.getInstance("your-mod-id", false);
@Override
public void onInitialize() {
LOGGER.info(">>> This is a plain message without any colouring");
LOGGER.info(">>> I want some green text", AnsiColorText.ANSI_BRIGHT_GREEN);
LOGGER.info(">>> I want some red text with a black background", AnsiColorText.ANSI_BRIGHT_RED, AnsiColorBackground.ANSI_BLACK_BACK);
}
}
If required, the `Logger` can be interfaced with by calling it as follows:
LOGGER.getLogger(); // Returns the Logger to be interfaced with.
This will, however, not implement the ANSI color coding to your output if accessed this way.
NOTE: A
ColorfulLoggervariable can be declared anywhere in the project. It is recommended, however, to only ever declare this once as it is a singleton.
To import the declared variable as a static import when referencing the variable:import static com.packagename.FabricMod.LOGGER;
ALTERNATIVELY:
ColorfulLoggercan be instantiated anywhere in the project as follows if required after the singleton is declared:public class References { private static final ColorfulLogger LOGGER = ColorfulLogger.getInstance(); public static ColorfulLogger getLogger() { return LOGGER; } }Then accessed:
import static com.package.References.getLogger; public class MyClass { References.getLogger(); }
Sources
[Only if using Modrinth Maven as a dependency]
There is a sources file available in the versions download.
This is a well define sources file where all variables, methods and constructors are well-defined as well as the class itself. You should download and add this file in the folder path:
.gradle/loom-cache/remapped_mods/net_fabricmc_yarn{version}/maven/colorfulloggerlib/{hs_colorful_logger_version}/
Note: Replace curly-braced text with current versions etc.
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
On ModDex
Community snapshot
By the numbers
Statistics
Want to reach Minecraft players?
We're looking for a server hosting partner to feature here and other parts of the site. Interested? Send us a message!
Get in touchGet it on
Available Platforms
On ModDex
Community snapshot
By the numbers

