Coder Social home page Coder Social logo

Comments (3)

bflad avatar bflad commented on June 13, 2024

Quick msgpack notes:

b, _ := msgpack.Marshal(/* ... */)
fmt.Printf("Bytes: %v", b) // [142 161 98 207 0 0 0 0 0 0 0 5 161 100 ...

var ret interface{}
decoder := msgpack.NewDecoder(bytes.NewReader(b))
decoder.UseDecodeInterfaceLoose(true)
err := decoder.Decode(&ret)
fmt.Printf("Friendlier: %v", ret) // map[a:5 b:5 c:5 d:true e:foo f:[102 111 111] ...

from terraform-plugin-go.

bflad avatar bflad commented on June 13, 2024

Since the data is a little unwieldy, maybe this could dump files separately from the logging. e.g. {TIMESTAMP}_{RPC}_(request|response).msgpack then those could be inspected.

Some additional references for inspection tooling:

from terraform-plugin-go.

bflad avatar bflad commented on June 13, 2024

To flush out the file-based proposal a little more:

Support a new environment variable, TF_LOG_SDK_PROTO_DATA_DIR, which sets a directory to save request and response DynamicValue data. When set and a RPC request or response with DynamicValue data crosses the server logic, open a file and save the raw data:

  • If len(msgpack) > 0, {TIMESTAMP}_{RPC}_(Request|Response|{MESSAGE})_{FIELD}.msgpack
  • If len(json) > 0, {TIMESTAMP}_{RPC}_(Request|Response|{MESSAGE})_{FIELD}.json

Enabling this also should automatically trace log the filenames as they are created.

from terraform-plugin-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.