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

battery-stats-collector should just issue usable lines on stdout and no warning. #23

Open
b3 opened this issue Sep 28, 2016 · 6 comments

Comments

@b3
Copy link
Contributor

b3 commented Sep 28, 2016

In battery-stats-collector when get_logline is unable to determine a value for ac_online it echoes a message warning that "No power supply found". This line then goes to the log file before the status line is echoed.

That way the generated file becomes unusable since every two lines it contains non-data. On my host it looks likes something like :

No power supply found
1474886747 56.11 1 2016/09/26 12:45:47 -
No power supply found
1474886807 56.45 1 2016/09/26 12:46:47 -
No power supply found
1474886867 56.82 1 2016/09/26 12:47:47 -

The warning line should not be echoed, or at least not on stdout.

@b3
Copy link
Contributor Author

b3 commented Sep 28, 2016

I created a branch on my fork which propose a solution to the issue : b3/fork-battery-stats@7ea441d

@b3
Copy link
Contributor Author

b3 commented Sep 28, 2016

I do not think that the missing power supply should cause a cron email. In fact I am unsure that this message should be raised at all. Without power supply detection battery-stats-collector still work.

My idea for the proposition was that if the connected status (online or offline) can be detected it should be logged, but if it can not be detected that information shoud be logged too.

That was why I proposed 3 states.

I do not presuppose any use of that last information though.

@petterreinholdtsen
Copy link
Owner

Right. make sense to me.

@b3
Copy link
Contributor Author

b3 commented Sep 29, 2016

Do you think my proposition should be integrated in your code? If yes I can just make a pull request of my demo branch.

@petterreinholdtsen
Copy link
Owner

[Bruno BEAUFILS]

Do you think my proposition should be integrated in your code? If yes
I can just make a pull request of my demo branch.

Yes. Please make a pull request.

Happy hacking
Petter Reinholdtsen

@GillesMocellin
Copy link
Contributor

I have the same message in logs "No power supply found".
For me, it's because my power supply is seen as ADP0, battery-stats-collector looks for aconline status in several places, including ADP1, but not ADP0.
Removing Warnings will solve the problem and perhaps others.
Adding a look at ADP0 will solve som problems too.

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

No branches or pull requests

3 participants