An email error exporter replacement
- Node 16.9 or higher
- Docker (optional)
- Clone the repository
- Run
npm install
to install dependencies
- Copy screepsCode/ErrorExporter(.js or .ts) to your bot folder and use it the following way: import or require the file, default and static class is exported which you should use to export errors with by executing
ErrorExporter.addErrorToSegment(errorMessage)
. - You can include an optional version number after the errorMessage param.
- Copy users.json.example to users.json and fill in your information. Name, shard, segment and authentication form are mandatory (see
users.json.example
)). - Copy .env.example to .env and fill in your discord webhook url if you do want this enabled.
- Run
npm run start
ornpm run start:docker
to start in docker.
- After installation, the tool will start to retrieve errors and save them by count every hour. You can change this by editing the
CRON_TAB_SYNTAX
variable in the .env file using the syntax generator. - About 200 errors can be saved in a segment per shard. If you are above 90% of the segment, it stops exporting and alerts your email via Game.notify in Screeps.
- By default, port 10003 is used for the API. You can change this at the top of the
errorsGetter/index
file. The URL is http://localhost:10003.
Add your GRAFANA_LOKI_URL
to the .env file to enable Grafana Loki logging.