2 Screenshots

About This File

To access the console press F11 ingame.

Motivation

RAGE console is designed to be a simple and universal logging library with support for client-side, including CEF and server-side. The server-side currently logs all the logs into separate daily files.

Installation

Installation is extremely simple

  1. Copy "packages" folder inside your server "packages" folder, except config.json if you have edited it
  2. Copy "client_packages" folder inside your "client_packages" folder
  3. Edit your "client_packages" -> index.js to include the rage-console with: require('_rage-console'); (remember to paste this on line 1)

Config

The config exists inside your 'packages/_rage-console/config.json'. You can freely edit these, if no data is provided it will default to default settings. These options are accepted by the config:

  • zippedArchive: A boolean to define whether or not to gzip archived log files. (default 'false')
  • name: Filename to be used to log to. This filename can include the date placeholder which will include the formatted. (default: 'YYYY-MM-DD')
  • maxSize: Maximum size of the file after which it will rotate. This can be a number of bytes, or units of kb, mb, and gb. If using the units, add 'k', 'm', or 'g' as the suffix. The units need to directly follow the number. (default: '30m')
  • maxFiles: Maximum number of logs to keep. If not set, no logs will be removed. This can be a number of files or number of days. If using days, add 'd' as the suffix. (default: '30d')
{
  "logs": {
    "name": "YYYY-MM-DD",
    "maxSize": '30m',
    "maxFiles": '30d',
    "zippedArchive": false
  }
}

Upgrading

Upgrading is extremely simple

  1. Copy "packages" folder inside your server "packages" folder
  2. Copy "client_packages" folder inside your "client_packages" folder

Usage

Can be used on server-side or client-side. You do not need to require the file as these are available globally.

Writes an info log to the console.

console.log('Hey! Log something?');

Writes an info log to the console.

console.info('Hey! Log something?');

Writes an warning log to the console.

console.warn('Hey! Log something?');

Writes an error log to the console.

console.error('Hey! Log something?');

Usage with CEF (Browser)

To use with CEF you need to add the following line to your HTML <head> element, put this to the top of all your script files.

<script src="package://_rage-console/CEF/debugger.js" crossorigin="anonymous"></script>

Build in commands

help — provides all the commands available

clear — clears all the logs

API 

Enable or disable access to console [client-side]

terminal.active = true/false;

Add command handler [client-side]

terminal.commands.add('pos', {
  description: 'Gets the position of the player'
}, function(...arguments) {
  return `   X: ${user.position.x.toFixed(2)}, Y: ${user.position.y.toFixed(2)}, Z: ${user.position.z.toFixed(2)} - R: ${user.getHeading(true).toFixed(2)}`;
});
  

Todo

  • Add options to disable and enable server-side log files
  • Add options to custom style the console, mainly due to accessibility
  • Run proper tests and clean the logic
  • Add ability to see which file the log is coming from
  • Add ability to be used with C bridge

Bugs/Feedback

Bugs should be reported currently in RAGE Discord channel to the username @Porn on private message, I appreciate any bugs being reported.

If you have a feature request please do the same as mentioned above.

This is currently in BETA and some stuff is still unpolished.


What's New in Version 0.3.0   See changelog

Released

  • Added debugging for CEF
  • Added API to add commands
  • Added API to disable console
  • New fresh look
  • Added scrolling to logs
  • Bug fixes
  • Greener garden
  • Like 7
  • Sad 1



User Feedback

Create an account or sign in to leave a review

You need to be a member in order to leave a review

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

ynhhoJ

   5 of 6 members found this review helpful 5 / 6 members

There are some minor bugs when using:

  • When you write to the console the letter "T" opens the main chat.
  • If you press "V", the player's camera changes his position.

Small demonstration:

 

 

Share this review


Link to review
Benny

   1 of 2 members found this review helpful 1 / 2 members
terminal.commands.add('pos', {
  description: 'Gets the position of the player'
}, function(...arguments) {
  return `   X: ${user.position.x.toFixed(2)}, Y: ${user.position.y.toFixed(2)}, Z: ${user.position.z.toFixed(2)} - R: ${user.getHeading(true).toFixed(2)}`;
});
  

Not Working !

Share this review


Link to review
notsosmart

   1 of 2 members found this review helpful 1 / 2 members

i like this scaleform console......

Share this review


Link to review
ziggi

  

Nice. But, can you release sources? It would be nice to build this with my webpack configuration.

Share this review


Link to review
rootcause

  

5/5 bretty gud

Share this review


Link to review
ragempdev

  

c bridge when

Share this review


Link to review