Skip to content

v0.5

Compare
Choose a tag to compare
@maddinat0r maddinat0r released this 06 May 14:54
· 29 commits to master since this release

BREAKING CHANGES

  • new, future-proof API
  • settings in server.cfg moved to new log-core.yml settings file:
    • logcore_debuginfo 0 (disabling debug info) is now DisableDebugInfo: true (global setting)
    • logtimeformat (setting for log time format, also used by SAMP directly) is now LogTimeFormat (global setting)

Logger configuration now takes place in a central file named log-config.yml, located in the server root directory (alongside the server binary). The structure and features available to be configured can be taken from following example:

Logger:
  plugins/mysql: # logger name
    LogLevel: All
    LogRotation:
      Type: Size
      Trigger: 10KB # supported units: KB (kilobyte), MB (megabyte), GB (gigabyte) (defaults to 100MB)
      BackupCount: 15 # max backup count to keep (defaults to 10)
    # LogRotation:
    #   Type: Date
    #   Trigger: Daily # supported times: Daily, Weekly, Monthly (defaults to Daily)
    #   BackupCount: 25
    Append: false # whether to append to log file or overwrite log file on each startup (defaults to true)
    PrintToConsole: true # prints log messages into the server console (defaults to false)
  system/player/item:
    LogLevel:
      - Warning
      - Error
      - Fatal
    LogRotation:
      Type: Size
      Trigger: 20MB
LogLevel: # per loglevel settings
  Error:
    PrintToConsole: true # prints all errors into the server console (defaults to false)
EnableColors: true # enables colors for server console output (defaults to false)
LogTimeFormat: '%y/%m/%d %H:%M:%S' # refer to https://en.cppreference.com/w/cpp/chrono/c/strftime for a list of all available specifiers (defaults to "%x %X")
#LogsRootFolder: 'custom-logs' (defaults to "logs")
#DisableDebugInfo: true (defaults to "false")