Skip to content

Commit

Permalink
First draft of MPFLogger docs
Browse files Browse the repository at this point in the history
  • Loading branch information
avanwinkle committed May 14, 2024
1 parent d7853b6 commit c057a7f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
37 changes: 37 additions & 0 deletions docs/gmc/reference/mpf-logger.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: MPFLogger
---

# MPFLogger

The `MPFLogger` is a special GMC node that provides access to logging functionality for GMC nodes within a scene.

To get logging from GMC nodes (a.k.a. nodes with class names that start with `MPF`), add an `MPFLogger` node to your scene and attach the nodes you wish to enable logging for.

## Node Configuration

An `MPFLogger` node can be added anywhere in a scene. Only GMC nodes that are attached via the `loggers` list will output logs at the selected level.

### enabled:

Single value, type `bool`. Default `true`.

If true, this logger will log events for the attached GMC nodes. If false, logging will be suppressed (i.e. only default warning/error logs will be output).

### log_level:

Single value. Default `INFO`.

The logging level of the GMC nodes to output.

### loggers:

Array of values, type `Node`.

A collection of GMC nodes to enable logging for at the selected `log_level`.

Click on *Array[Node]* to expand the list and then click *+ Add Element* to add a node to the logger. GMC nodes (those that start with `MPF`) support logging through `MPFLogger`, other node types will be ignored.

!!! note "Name Your Nodes"

Loggers will output their logs with the name of the node prepended. If you have not renamed the nodes in the Scene tree from their default names, it may be difficult to ascertain which node is logging which lines.
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ nav:
- MPFChildPool: gmc/reference/mpf-child-pool.md
- MPFConditional: gmc/reference/mpf-conditional.md
- MPFConditionalChildren: gmc/reference/mpf-conditional-children.md
- MPFLogger: gmc/reference/mpf-logger.md
- MPFDisplay: gmc/reference/mpf-display.md
- MPFSlide: gmc/reference/mpf-slide.md
- MPFSoundAsset: gmc/reference/mpf-sound-asset.md
Expand Down

0 comments on commit c057a7f

Please sign in to comment.