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

Remove support for the 'fileline' attribute in log formats #678

Merged
merged 3 commits into from
Oct 6, 2018

Conversation

jamessynge
Copy link
Contributor

This non-standard attribute has been the cause of many problems,
so reverting back to using only the default attributes.

This non-standard attribute has been the cause of many problems,
so reverting back to using only the default attributes.
@@ -7,8 +7,7 @@ logger:
datefmt: '%H:%M:%S'
detail:
style: '{'
# See FilenameLineFilter in logger.py for fileline description
format: '{levelname:.1s}{asctime}.{msecs:03.0f} {fileline:20s} {message}'
format: '{levelname:.1s}{asctime}.{msecs:03.0f} {filename} {lineno} {message}'
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer we still have a fixed length for filename and lineno so the the message always start with a left flush. I could live without but I think it makes reading easier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@codecov
Copy link

codecov bot commented Oct 5, 2018

Codecov Report

Merging #678 into develop will decrease coverage by 0.15%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           develop    #678      +/-   ##
==========================================
- Coverage    78.06%   77.9%   -0.16%     
==========================================
  Files           61      61              
  Lines         5069    5064       -5     
  Branches       696     696              
==========================================
- Hits          3957    3945      -12     
- Misses         898     903       +5     
- Partials       214     216       +2
Impacted Files Coverage Δ
pocs/utils/logger.py 84.61% <ø> (-1.1%) ⬇️
pocs/serial_handlers/protocol_arduinosimulator.py 75.28% <0%> (-1.55%) ⬇️
pocs/camera/camera.py 89.94% <0%> (-1.06%) ⬇️
pocs/observatory.py 89.67% <0%> (-0.33%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6393d33...6482e77. Read the comment docs.

@jamessynge
Copy link
Contributor Author

Should fix #393.

Right align the filename in a 25 char field space (if it fits),
and pad the lineno to 3 chars with zero if lower than 100.
For most of our files, this will result in a fixed length prefix
before the message, thus making it somewhat easier to find the
message.
The ] will be on all log lines, between the (usually) fixed length
prefix and the message.
@jamessynge jamessynge merged commit df915fd into panoptes:develop Oct 6, 2018
@jamessynge jamessynge deleted the fileline-issue-393 branch October 13, 2018 20:23
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.

2 participants