Skip to content

feat(redux logs): 82 export redux logs

CD Cabrera requested to merge 82-redux-logs into master

What's included

  • feat(redux logs): 82 export redux logs
    • actionRecordMiddleware, session storage for the last 100 actions
    • expose app global download for log, generic file download helper
    • restructure store.js and moved middleware to to middleware/index
    • dotenv for logger id, logger file name

How to test

The regular review setup can always be used for a confirmation. You'll need a login, and access to a Cloudigrade instance.

  1. You may need to log in, do so
  2. Open the console in your browser, then type debugLogDownload(), hit the enter/return key, a JSON file should automatically download, the name should be something like cloudmeter_debug_log_[CURRENT DATE TIME].json.

The local run review setup can be used to help a quick confirmation. You'll need a login, or access to a Cloudigrade instance.

  1. Clone the updates locally, then
  2. From the terminal, within the repo context, run $ yarn start:review
  3. You may need to log in, do so
  4. Open the console in your browser, then type debugLogDownload(), hit the enter/return key, a JSON file should automatically download, the name should be something like cloudmeter_debug_log_[CURRENT DATE TIME].json.

The mock dev setup can be used to help a quick confirmation.

  1. Clone the updates locally, then
  2. From the terminal, within the repo context, run $ yarn start
  3. You may need to log in, do so
    • Note: the local dev server will take any combo of email/made up password to log in
  4. Open the console in your browser, then type debugLogDownload(), hit the enter/return key, a JSON file should automatically download, the name should be something like cloudmeter_debug_log_[CURRENT DATE TIME].json.

Example

The output from the debug log should resemble something

[
  ...
  {
    "diff": 11,
    "timestamp": 1548211478872,
    "action": {
      "type": "USER_LOCALE_FULFILLED",
      "payload": {
        "data": {
          "value": "en",
          "key": "English"
        }
      }
    }
  },
  {
    "diff": 96,
    "timestamp": 1548211478968,
    "action": {
      "type": "2XX_STATUS_RANGE",
      "status": 200,
      "range": "2XX",
      "message": "OK"
    }
  },
  {
    "diff": 65,
    "timestamp": 1548211479033,
    "action": {
      "type": "0_STATUS_RANGE",
      "status": 0,
      "range": 0,
      "message": " Server is currently unable to handle this request."
    }
  },
  {
    "diff": 5,
    "timestamp": 1548211479038,
    "action": {
      "type": "GET_ACCOUNTS_PENDING"
    }
  },
  {
    "diff": 19,
    "timestamp": 1548211479057,
    "action": {
      "type": "USER_INFO_FULFILLED",
      "payload": {
        "data": {
          "email": "test@redhat.com",
          "id": 1,
          "username": "developer"
        },
        "status": 200,
        "statusText": "OK",
        "headers": {
          "content-type": "application/json; charset=utf-8",
          "cache-control": "no-cache"
        },
        "config": {
          "transformRequest": {},
          "transformResponse": {},
          "timeout": "60000",
          "xsrfCookieName": "XSRF-TOKEN",
          "xsrfHeaderName": "X-XSRF-TOKEN",
          "maxContentLength": -1,
          "headers": {
            "Accept": "application/json, text/plain, */*",
            "Authorization": "XXXX"
          },
          "method": "get",
          "url": "/auth/me/"
        },
        "request": {}
      }
    }
  } 
  ... 
]

Updates issue/story

updates #82 (closed)

Edited by CD Cabrera

Merge request reports