• Hawk - The boss way to log.
    14 replies, posted
I've been working on a addon called "Hawk" Its a logging addon that logs almost everything, from connecting, to buying items. Its now almost done. I just need some suggestions on what to log, and some small bugfixes. DOWNLOAD 0.6BETA: [url]http://dl.dropbox.com/u/15584452/HawkB06.zip[/url] Please check back often for updates REQUIRED MODULE: [url]http://www.facepunch.com/threads/695636[/url] - If you do not have this module, PlayerConnect will not work. Features: - ConVars for certain log kinds. - Modular Logging System. (Notice 1) - Seperate Logs and one main log. (Notice 1): To Regular People/Coders: Plugins for Hawk automaticly create the logfile, and the ConVar Hawk_Log_(pluginname) (1/0) To Lua Coders: If you would like to create your own logging module, Follow this example. [lua] local HAWKPlugin = {} // We're making a HAWK plugin so, we need this local HAWKPlugin.Name = "FagLogger" // Name for our plugin. local HAWKPlugin.Author = "FuriousJack95" // Our name. hook.Add("PlayerConnect", "HAWK_LogFags", function(name, ip) // Create our hooked function if name == "Wizard of Ass" then // holy fuck its a dinosaur HAWK_Log("LogFags", "We're all going to die! "..name.." has joined!") // Log it, arg[1] == LogName arg[2] == What to log. end end) [/lua]
Are there convars to filter certain types of logs?
[QUOTE=Chessnut;33845720]Are there convars to filter certain types of logs?[/QUOTE] Im adding that in now, thanks.
The op example would not work.
[QUOTE=Derek_SM;33847838]The op example would not work.[/QUOTE] And why wouldnt it?
Look at the function variables/arguments again
[QUOTE=tazy4tazy;33845391]Its a logging addon that logs almost everything, from connecting, to buying items.[/QUOTE] Based on which shop? It also looks a lot like all this does is write to a file. I would expect more from an addon that claims to be "the boss way to log". Filtering by Steamid / Date , a nice GUI to search through logs, etc etc.
[QUOTE=_nonSENSE;33848499]Based on which shop? It also looks a lot like all this does is write to a file. I would expect more from an addon that claims to be "the boss way to log". Filtering by Steamid / Date , a nice GUI to search through logs, etc etc.[/QUOTE] Well, my gamemodes custom shop, but its a plugin so, you wont be able to get it. If you want/need me to create a plugin for an addon, I gladly will. Keep in mind: That you can easily use HAWK_Log(LogType, ToLog) and it will automaticly create any files/convars you need. Im gonna add some more features such as filtering and a gui, and yes, I just realized the error in the OP.
Yeah, you still have errors in the example.
It seems there is almost no purpose the plugin system, you could create a system for disabling/enabling by creating hooks and destroying hooks like this: [lua] local PLUGIN = {} PLUGIN.Name = "Log Disconnects" PLUGIN.Enabled = true --Enabled at default PLUGIN.Author = "KillerLUA" function PLUGIN.Enable() print("[HawkPlugin] Disconnect plugin enabled!") hook.Add("PlayerDisconnect", "HPLUGIN_DisconnectLog", function() /* Do stuff */ end) end function PLUGIN.Disable() print("[HawkPlugin] Disconnect plugin disabled!") hook.Remove("PlayerDisconnect", "HPLUGIN_DisconnectLog") end RegisterHawkPlugin("disconnect_log", PLUGIN) -- IN YOUR PLUGIN FILE REGISTER THINGY FILE -- HawkPlugins = {} function RegisterHawkPlugin(name, tbl) if not tbl then return end HawkPlugins[name] = tbl end function TogglePluginStatus(name) local plugin = HawkPlugins[name] plugin.Enabled = not plugin.Enabled if plugin.Enabled == true then plugin.Disable() else plugin.Enable() end end [/lua] I also suggest you add support for people who don't use the module, you can still show a error message, or create a timer that sends a message to every admin saying that 'Hawk was installed incorrectly!' Using the enabled system, you could add a simple checkbox list to enable/disable plugins, when something changes, just send a datastream. I would also futureproof by doing: [lua] if datastream then --Datastream or Datastream 2.0 installed or we're just plainly not beta else --Gmod beta, use the net library end [/lua] Nice work so far
[QUOTE=KillerLUA;33866345]It seems there is almost no purpose the plugin system, you could create a system for disabling/enabling by creating hooks and destroying hooks like this: [lua] local PLUGIN = {} PLUGIN.Name = "Log Disconnects" PLUGIN.Enabled = true --Enabled at default PLUGIN.Author = "KillerLUA" function PLUGIN.Enable() print("[HawkPlugin] Disconnect plugin enabled!") hook.Add("PlayerDisconnect", "HPLUGIN_DisconnectLog", function() /* Do stuff */ end) end function PLUGIN.Disable() print("[HawkPlugin] Disconnect plugin disabled!") hook.Remove("PlayerDisconnect", "HPLUGIN_DisconnectLog") end RegisterHawkPlugin("disconnect_log", PLUGIN) -- IN YOUR PLUGIN FILE REGISTER THINGY FILE -- HawkPlugins = {} function RegisterHawkPlugin(name, tbl) if not tbl then return end HawkPlugins[name] = tbl end function TogglePluginStatus(name) local plugin = HawkPlugins[name] plugin.Enabled = not plugin.Enabled if plugin.Enabled == true then plugin.Disable() else plugin.Enable() end end [/lua] I also suggest you add support for people who don't use the module, you can still show a error message, or create a timer that sends a message to every admin saying that 'Hawk was installed incorrectly!' Using the enabled system, you could add a simple checkbox list to enable/disable plugins, when something changes, just send a datastream. I would also futureproof by doing: [lua] if datastream then --Datastream or Datastream 2.0 installed or we're just plainly not beta else --Gmod beta, use the net library end [/lua] Nice work so far[/QUOTE] I'll probably add some more advanced stuff once I can log alot of stuff.
[QUOTE=tazy4tazy;33879476]I'll probably add some more advanced stuff once I can log alot of stuff.[/QUOTE] Cut the crap bro. This is your first minor-major attempt at getting praised, and just an fyi, it's not going to happen. Nice attempt though. Also all this 'logging' does is save to a file. At least add a motherfucking convar for owners to decide whether it should save to a file only, or log in a menu for all admins to see. Go do some more minor projects, maybe some that involve client-server GUI, and self-updating GUI. Come back after you're done and remake this from scratch. Also, when you recreate this actually have a use for the modular system, if you create one at all. -snip'd I was in ranting mood and I just let out all of that.-
[QUOTE=Derek_SM;33879821] Offtopic: I absolutely [b]hate[/b] that you bought gold membership, because imo you do not deserve it at all. Gold membership should be about people that have been in the community for years and did something for the community that people praise, something NOT like this.[/QUOTE] Who gives a fuck?
Anyway, Im gonna start work on the Hawk Admin Panel, so.
[QUOTE=tazy4tazy;33881134]Anyway, Im gonna start work on the Hawk Admin Panel, so.[/QUOTE] Good luck working on the admin panel when you can't even fix the damn op example.
Sorry, you need to Log In to post a reply to this thread.