Skip to content

Commit

Permalink
logging cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
obra committed Sep 27, 2023
1 parent 852d5f0 commit f0f26b6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
6 changes: 2 additions & 4 deletions src/renderer/ActiveDevice.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,16 @@ export function ActiveDevice() {
if (newValue !== undefined) {
if (isEqual(newValue, this._cache[command])) {
// If the values are the same, don't bother sending it to the device.
console.log("Not sending a value that matches what's on the device");
console.debug("Not sending a value that matches what's on the device");
return cloneDeep(this._cache[command]);
}

await this.focus.command(command, newValue);
delete this._cache[command];
}
if (!(command in this._cache)) {
console.log("fetching uncached value for " + command + " from device");
this._cache[command] = await this.focus.command(command);
console.log("Got a value", [this._cache[command]]);
console.log("Got a previosuly uncached value", [this._cache[command]]);
}
console.log(
"Returning a cached value for " + command + ":",
Expand Down Expand Up @@ -178,7 +177,6 @@ export function ActiveDevice() {

Object.keys(cacheableFocusCommands).forEach((command) => {
this[command] = async (newValue) => {
console.log("Inside " + command + " with " + newValue);
return await this._cachedDeviceData(
cacheableFocusCommands[command],
newValue
Expand Down
1 change: 1 addition & 0 deletions src/renderer/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ const App = (props) => {
};

const onKeyboardDisconnect = async () => {
console.log("onKeyboardDisconnect called");
if (activeDevice) {
console.info("Disconnecting from keyboard", {
activeDevice: activeDevice,
Expand Down
4 changes: 1 addition & 3 deletions src/renderer/screens/LayoutCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/


import KeymapDB from "@api/focus/keymap/db";
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
Expand Down Expand Up @@ -83,14 +82,12 @@ const LayoutCard = (props) => {
error: e,
});
toast.error(e);
props.onDisconnect();
}
};

useEffectOnce(() => {
const initialize = async () => {
await scanKeyboard();

setOneLayerPerPage(settings.get("ui.layoutCards.oneLayerPerPage", false));

setLoading(false);
Expand Down Expand Up @@ -147,6 +144,7 @@ const LayoutCard = (props) => {
}
}


return (
<React.Fragment>
<PageTitle title={title} />
Expand Down

0 comments on commit f0f26b6

Please sign in to comment.