jam1garner / cargo-binrw

WIP cargo subcommand for debugging
1 stars 1 forks source link

Properties File #2

Closed dmgolembiowski closed 3 years ago

dmgolembiowski commented 3 years ago

My initial draft for the cargo-binrw file format is to leverage Ron and (for now) support only a single logging server with the following configurable properties:

If Ron is acceptable, I think it could look like:

Binrw([
    (
        project: my_project,
        host: "127.0.0.1"
        port: 42069,
        editor_host: "127.0.0.1",
        editor_port: 42070,
        silent_foreground: false,
        logging: Logging(
            enabled: false
            output_file: "$CARGO_MANIFEST_DIR/binrw.log",
            mode: 'a'
        ),
    ),
])
dmgolembiowski commented 3 years ago

Better yet, let's simplify things and create this as:

# {{ project }}.toml
[project]
name = "{{ project }}" # default project name is "my-binrw-project"
host = "{{ host }}" # default value is "127.0.0.1"
port = "{{ port }}"  # default value is "31958"
silent_foreground = false # output is not sent to stdout and stderr; a TTY is spawned if this is set to `true`. 

[logging]
enabled = false # logging is not enabled by default
output_file = "$CARGO_MANIFEST_DIR/binrw.log" # will panic if write permission is not available
mode = "append" # Viable modes: "append" and "overwrite"
dmgolembiowski commented 3 years ago

Closing this because corresponding issues will be opened for action items