• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Library] samp-logging | Log gamemode
#1
This library allow you to use few functions to log your gamemode.

Installation

Simply install to your project:

Code:
[/align]

[align=center]sampctl package install Mergevos/samp-logging[/align]

[align=center]

Include in your code and begin using the library:

Code:
[/align]

[align=center]#include <logging>[/align]

[align=center]

Important note

It does need a latest version of the community compiler. You can download it from here: https://github.com/pawn-lang/compiler

Usage

There're 4 functions. Since the last version has had params for line and file name, this one doesn't.

File and line are now automatically detected and it returns the full path to the file and line number.

This function logs an debug message.

Code:
[/align]

[align=center]Log_Debug(const handle[], const message[], Logging_Fields: ...)[/align]

[align=center]handle[] - Debug handle[/align]

[align=center]message[] - Text to log[/align]

[align=center]... - Other arguments (fields)[/align]

[align=center]

This function logs a fatal error. It ends server after being executed.

Code:
[/align]

[align=center]Log_Fatal(const handle[], const message[], Logging_Fields: ...)[/align]

[align=center]

This function logs a verbose message. It outputs amx backtrace via crashdetect.

Code:
[/align]

[align=center]Log_Verbose(const handle[], const message[], Logging_Fields: ...)[/align]

[align=center]

This function logs an info message.

Code:
[/align]

[align=center]Log_Info(const handle[], const message[], Logging_Fields: ...)[/align]

[align=center]

This function logs an error message.

Code:
[/align]

[align=center]Log_Error(const handle[], const message[], Logging_Fields: ...)[/align]

[align=center]

This function logs an usage message.

Code:
[/align]

[align=center]Log_Usage(const handle[], const message[], Logging_Fields: ...)[/align]

[align=center]

Testing

To test, configure pawn.json and simply run the package:

Code:
[/align]

[align=center]sampctl package run[/align]

[align=center]

  Reply
#2
Incomparable to samp-logger but good job... Not good not terrible

Edit: At least credit Southclaws xD
Using Pawn.CMD?

If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
  Reply


Forum Jump: