Skip to content

Commit

Permalink
Improve README
Browse files Browse the repository at this point in the history
  • Loading branch information
stirante committed Dec 5, 2023
1 parent 89d1a0f commit c4365b5
Showing 1 changed file with 47 additions and 42 deletions.
89 changes: 47 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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 <level either as string or as a number>
scriptevent logger:filter <comma separated tags>
```

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
Expand Down Expand Up @@ -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 <level either as string or as a number>
scriptevent logger:filter <comma separated tags>
```

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.
Expand Down

0 comments on commit c4365b5

Please sign in to comment.