#is there a way to make custom logs?

1 messages · Page 1 of 1 (latest)

ancient loom
#

like I can just log something with adonis, like boomboxes
like chatlogs and it's formatted timestamp:player:soundid
and have a custom command to open the logs for it?

broken sparrow
#

YEs

spice ore
ancient loom
spice ore
simple plinth
# spice ore how can i actually make my own logger though as ive read this and it just confus...
return function(Vargs)
    local server, service = Vargs.Server, Vargs.Service

    local oldTabToType = server.Logs.TabToType
    server.Logs.CustomLogs, server.Logs.TabToType, server.Logs.ListUpdaters.CustomLogs = {}, function(tab: any, ...: any): string
        if tab == server.Logs.CustomLogs then
            return "CustomLogs"
        else
            return oldTabToType(tab, ...)
        end
    end, function(_)
        return server.Logs.CustomLogs
    end

    server.Commands.CustomLogs = {
        Prefix = server.Settings.Prefix;
        Commands = {"customlogs"};
        Args = {"autoupdate? (default: false)"};
        Description = "View the logs";
        AdminLevel = "Moderators";
        ListUpdater = "CustomLogs";
        Function = function(plr: Player, args: {string})
            server.Remote.MakeGui(plr, "List", {
                Title = "Custom Logs";
                Table =  server.Logs.ListUpdaters.CustomLogs(plr);
                Update = "CustomLogs";
                AutoUpdate = if args[1] and (string.lower(args[1]) == "true" or string.lower(args[1]) == "yes") then 1 else nil;
                Sanitize = true;
            })
        end
    }

    server.Admin.CacheCommands()

    --// Code goes here
end
#

heres a template

#

also things you need to change is any instance of "CustomLogs" to whatever you want