From c4365b5fb9e7ecfed8efffd1fe0e758c281c44de Mon Sep 17 00:00:00 2001 From: stirante Date: Tue, 5 Dec 2023 21:27:57 +0100 Subject: [PATCH] Improve README --- README.md | 89 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 47 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 3a2c43a..742e83f 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,8 @@ npm install @bedrock-oss/bedrock-boost ### Vec3 Class +[Documentation](docs/vec3.md) + ```typescript import { Vec3 } from "@bedrock-oss/bedrock-boost"; import { world } from "@minecraft/server"; @@ -39,6 +41,51 @@ world.beforeEvents.itemUse.subscribe((event) => { ``` +### Logger + +[Documentation](docs/logging.md) + +```typescript +import { Logger } from "@bedrock-oss/bedrock-boost" + +const log = Logger.getLogger("main", "tag1", "tag2"); +log.info("Hello, Minecraft World!"); +``` + +It also includes 2 commands to control the logging system: +``` +scriptevent logger:level +scriptevent logger:filter +``` + +When using esbuild, you can use `dropLabels` option with `LOGGING` label to remove all logging code from the final bundle. + +When using [gametests regolith filter](https://github.com/Bedrock-OSS/regolith-filters/tree/master/gametests), you can configure it like this: +```json +{ + "filter": "gametests", + "settings": { + "modules": [ + // ... + ], + "buildOptions": { + "dropLabels": ["LOGGING"] + } + } +} +``` + +### ChatColor and ColorJSON classes + +[Documentation](docs/colorJson.md) + +```typescript +import { Logger } from "@bedrock-oss/bedrock-boost" + +const log = Logger.getLogger("main", "tag1", "tag2"); +log.info("Hello, Minecraft World!"); +``` + ### playerPolyfill ```typescript @@ -78,48 +125,6 @@ Timings.begin("big operation 2"); Timings.end(); ``` -### ChatColor and ColorJSON classes - -```typescript -import { Logger } from "@bedrock-oss/bedrock-boost" - -const log = Logger.getLogger("main", "tag1", "tag2"); -log.info("Hello, Minecraft World!"); -``` -``` - -### Logger - -```typescript -import { Logger } from "@bedrock-oss/bedrock-boost" - -const log = Logger.getLogger("main", "tag1", "tag2"); -log.info("Hello, Minecraft World!"); -``` - -It also includes 2 commands to control the logging system: -``` -scriptevent logger:level -scriptevent logger:filter -``` - -When using esbuild, you can use `dropLabels` option with `LOGGING` label to remove all logging code from the final bundle. - -When using [gametests regolith filter](https://github.com/Bedrock-OSS/regolith-filters/tree/master/gametests), you can configure it like this: -```json -{ - "filter": "gametests", - "settings": { - "modules": [ - // ... - ], - "buildOptions": { - "dropLabels": ["LOGGING"] - } - } -} -``` - ## Contributing Feel free to raise an issue or submit a pull request if you have any improvements or features to suggest.