SkLogging icon

SkLogging -----

A script that provides a basic function for custom logging within your scripts.



SkLogging

-----------------------------------------------------------------------------------------------------

Skript Version: Skript-2.8.5
Optional Addons:

skCord: skCord-2.3-RELEASE-all

-----------------------------------------------------------------------------------------------------
This is a small script I made that lets you add pseudo-logging to your other scripts via a simple function call.

Please note that I am not a Skript expert, I do not plan on consistently updating this, nor am I good at explaining things. The info below is probably really needlessly long and drawn out. Sorry.

For the sake of keeping things simple, these are the 5 "Levels" of logging I've added, explained via an image from this fiberplane article:
[​IMG]
In this script, the only logs you will see are those equal to or higher than that of your server's logging level variable. For example, let's say you write a bunch of implementations for debugging, but you don't want to see them constantly, set your level to "Warn" and you will only see Warn and higher.
Info will always be displayed regardless of the level, because, it's info, you should be using it for things you always want to see.

Now to get into the nitty-gritty usage stuff. (Clearly, I'm not a professional resource-maker)

Changing Your Level:
You can change your level in-game via the command
Code (Text):
/sklogginglevel <level>
the permission for which is set in the file Options.

Options:
All of the options are listed at the top of the script, with (hopefully) helpful comments explaining what they are used for, and what values you can use. These are things like whether or not you want to log in to the Console, in Chat, in Discord, what the prefixes, colors, and formatting should be, etc.

Discord:
Discord support is added via skCord and uses a webhook to post embeds in a specific channel. No bot configuration is needed. Simply edit your channel, go to integrations, webhooks, create a webhook, and copy the URL into the 'DiscordWebhook' option. I added a couple of cool features, like including a player's name and an image of their skin, for logging player interactions.

Actual Usage Example:
Code (Text):

command /hug [<offline player>]:
  trigger:
    if arg-1 is set:
      message "&d%player% &fhas hugged you!" to arg-1
      message "&fYou have hugged &d%arg-1%&f!" to player
      skLog("Info", "%player% has hugged %arg-1%", "https://visage.surgeplay.com/bust/%player%.png", "%player%")
    else:
      message "&fYou hugged yourself... :(" to player
      skLog("Warn", "%player% hugged themselves! They need a friend STAT!", "https://visage.surgeplay.com/bust/%player%.png", "%player%")
 
Which would result in...
[​IMG]
[​IMG]
[​IMG]
or...
[​IMG]
[​IMG]
[​IMG]
* Underlining due to my name & markdown formatting.

Well uhh, leave comments if you have any questions, suggestions, etc :)
Resource Information
Author:
----------
Total Downloads: 45
First Release: May 31, 2024
Last Update: May 31, 2024
Category: ---------------
All-Time Rating:
0 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings