Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

Commit

Permalink
chore: Move inflating buttplug section, fix broken links
Browse files Browse the repository at this point in the history
  • Loading branch information
qdot committed Dec 21, 2022
1 parent 1b9c8d3 commit b018a04
Show file tree
Hide file tree
Showing 18 changed files with 43 additions and 208 deletions.
110 changes: 0 additions & 110 deletions developer-guide/.vuepress/config.js

This file was deleted.

Binary file not shown.
1 change: 0 additions & 1 deletion developer-guide/.vuepress/public/buttplug.svg

This file was deleted.

8 changes: 0 additions & 8 deletions developer-guide/.vuepress/styles/index.styl

This file was deleted.

8 changes: 0 additions & 8 deletions developer-guide/README.md

This file was deleted.

69 changes: 0 additions & 69 deletions developer-guide/SUMMARY.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Adding to Buttplug Core
# Adding to Buttplug

This section covers development on Buttplug Core pieces, including:
This section covers development on Buttplug pieces, including:

- Implementing Buttplug clients in new languages
- Adding new device subtype managers to servers
- Adding new devices to servers
- Writing new Buttplug servers
- Proposing and adding new messages to the Buttplug Protocol

Or at least, it will cover it. There's nothing here yet.
2 changes: 1 addition & 1 deletion docs/writing-buttplug-applications/api-basics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ change often, [I'm just going to refer you to the buttplug-js README about webpa
setup](https://github.com/buttplugio/buttplug-rs-ffi/tree/master/js#using-buttplug-with-webpack),
which will have the latest information on how to do this. If you have issues, either [file an issue
on our FFI repo](https://github.com/buttplugio/buttplug-rs-ffi) or [contact us via one of the
support mechanisms (preferably discord)](intro/getting-help.html).
support mechanisms (preferably discord)](intro/getting-help).

</TabItem>
</Tabs>
Expand Down
6 changes: 5 additions & 1 deletion docs/writing-buttplug-applications/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ We'll now cover the minimal amount of information needed to get you up and runni

## This Ain't Everything

This section will cover the absolute minimum functionality you need to get up and running with Buttplug. However, the library is far more extensive than this section covers. It is recommended you go through this section first, get a simple program up and running with your hardware, then check out the [Winning Ways section](/cookbook/intro.html) for advice on how to structure your application and use some of the other features in the library.
This section will cover the absolute minimum functionality you need to get up and running with
Buttplug. However, the library is far more extensive than this section covers. It is recommended you
go through this section first, get a simple program up and running with your hardware, then check
out the [Winning Ways section](/cookbook/intro) for advice on how to structure your application and
use some of the other features in the library.

## Example Code Access

Expand Down
36 changes: 28 additions & 8 deletions docs/writing-buttplug-applications/logging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,36 @@ import RustLoggingExample from '!!raw-loader!/examples/rust/src/bin/logging.rs';

# Logging

Buttplug exposes a few methods to receive log messages from the internal Rust library. These messages relay the internal state of the system, and can be handy for debugging purposes.
Buttplug exposes a few methods to receive log messages from the internal Rust library. These
messages relay the internal state of the system, and can be handy for debugging purposes.

## Message Exposure

What log messages you'll get depend on the type of system you're building. If you are using an embedded connector (i.e. server and client in the same process), you'll get both client and server information. If you're using a remote connector (i.e. your application uses the client, and the server is in another process/on another machine), you'll only receive log messages for the client. This preserves privacy for users who may not want to reveal information about their local setup to a untrusted client (For more information, see the [Privacy Models section of the this guide](cookbook/privacy-models.markdown)).
What log messages you'll get depend on the type of system you're building. If you are using an
embedded connector (i.e. server and client in the same process), you'll get both client and server
information. If you're using a remote connector (i.e. your application uses the client, and the
server is in another process/on another machine), you'll only receive log messages for the client.
This preserves privacy for users who may not want to reveal information about their local setup to a
untrusted client (For more information, see the [Privacy Models section of the this
guide](cookbook/privacy-models)).

This model may may things challenging to debug, which is why we recommend doing initial development in an embedded context if possible, the moving to remote once core development is set.
This model may may things challenging to debug, which is why we recommend doing initial development
in an embedded context if possible, the moving to remote once core development is set.

## Accessing Logs

Logs are generated in Rust using the [tracing crate](https://github.com/tokio-rs/tracing). This functionality is exposed to Rust via normal tracing subsystems (for instance, output to stdout via tracing_subscriber::fmt), or via various language specifics for FFIs (C# and JS have the ability to emit log messages as events).
Logs are generated in Rust using the [tracing crate](https://github.com/tokio-rs/tracing). This
functionality is exposed to Rust via normal tracing subsystems (for instance, output to stdout via
tracing_subscriber::fmt), or via various language specifics for FFIs (C# and JS have the ability to
emit log messages as events).

:::tip Temporary FFI Logging Limitations

At the time of this writing, logging capabilties in FFI instances are somewhat limited. Logging must be started manually, can only be set to one level for a session (i.e. if logging is started a "Debug or higher" levels, it will stay there for the remainder of the process), and only comes as string. As library development progresses, this system will be tuned to allow finer grained access to control and log information.
At the time of this writing, logging capabilties in FFI instances are somewhat limited. Logging must
be started manually, can only be set to one level for a session (i.e. if logging is started a "Debug
or higher" levels, it will stay there for the remainder of the process), and only comes as string.
As library development progresses, this system will be tuned to allow finer grained access to
control and log information.

:::

Expand All @@ -42,12 +57,16 @@ Available log levels are as follows:
<Tabs groupId="examples">
<TabItem value="rust" label="Rust">

Handling and/or outputting log messages in Rust is left up to the user, via normal methods of output for the [tracing crate.](https://github.com/tokio-rs/tracing) To output messages to stdout (i.e. the console) we recommend using the [tracing_subscriber](https://docs.rs/tracing-subscriber/) create with its fmt instance, like so:
Handling and/or outputting log messages in Rust is left up to the user, via normal methods of output
for the [tracing crate.](https://github.com/tokio-rs/tracing) To output messages to stdout (i.e. the
console) we recommend using the [tracing_subscriber](https://docs.rs/tracing-subscriber/) create
with its fmt instance, like so:

<CodeBlock language="rust">{RustLoggingExample}</CodeBlock>


tracing_subscriber::fmt uses environment variables to set log level filters. The filters are strings set to the levels mentioned in the previous section.
tracing_subscriber::fmt uses environment variables to set log level filters. The filters are strings
set to the levels mentioned in the previous section.

To set up log output using tracing_subscriber on a shell, you can use

Expand All @@ -61,7 +80,8 @@ To set this up in Powershell on windows, you can use
$env:RUST_LOG="debug"
```

Running the example above, you should see something like this (may not be exact. For instance, most people probably won't be writing sex toy software documentation on Christmas.):
Running the example above, you should see something like this (may not be exact. For instance, most
people probably won't be writing sex toy software documentation on Christmas.):

```
Dec 25 20:49:11.826 INFO buttplug::server::comm_managers::btleplug: Setting bluetooth device event handler.
Expand Down
5 changes: 5 additions & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ const sidebars = {
'cookbook/privacy-models',
'cookbook/raw-device-commands'],
},
{
type: 'category',
label: 'Inflating Buttplug',
items: ['inflating-buttplug/intro'],
},
],
};

Expand Down

0 comments on commit b018a04

Please sign in to comment.