Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug logging #323

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Debug logging #323

wants to merge 4 commits into from

Conversation

jmbrunskill
Copy link
Contributor

Fixes #322

I couldn't figure out a good pattern for enabling it on start up.
After various different attempts I've put it into the DependancyContainer.
Probably not the right place but figure if it's working, it's better then nothing?

@@ -131,7 +131,9 @@ export function* tryProgramNewSensor({
);
ToastAndroid.show(`Connected and setup ${macAddress}`, ToastAndroid.SHORT);
} catch (e) {
yield put(ProgramAction.programNewSensorFail(macAddress, e?.toString()));
yield put(
ProgramAction.programNewSensorFail(macAddress, e?.toString() ?? 'FAILED TO PROGRAM SENSOR')
Copy link
Contributor Author

@jmbrunskill jmbrunskill Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a side track but was giving me errors...

@@ -123,6 +124,22 @@ export const DependencyContainer: FC = ({ children }) => {
})();
}, []);

useEffect(() => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Above we are settings ready = true and we have all of the services available (without query to DependencyLocator), I think we should move this logic there

@andreievg
Copy link

I would increase number of logs we keep: Debug-Logging...Debug-Logging(Increase-number-of-logs-we-keep)

Copy link

@andreievg andreievg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great thanks, just some suggestions.

I think we should increase how much logs we are saving, especially once below takes place

Also to solve this issue (in another PR): #318, I think we need some raw data from:

saveLogs = async (logsToSave: Partial<TemperatureLog>[]): Promise<TemperatureLog[]> => {
<- log actual sensor logs we are saving

<- log data, we could add automated test after that

I guess above would need to be under 'Debug' log levels ?

…e-number-of-logs-we-keep)

Increase number of logs we keep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Debug logging isn't persisted after a restart
2 participants