Skip to content

Comments

log2text.py: added --min-level#22

Merged
segev-lior merged 3 commits intomasterfrom
lior/min-level
Dec 8, 2016
Merged

log2text.py: added --min-level#22
segev-lior merged 3 commits intomasterfrom
lior/min-level

Conversation

@segev-lior
Copy link
Contributor

No description provided.

self._clock = self._relativeClock if relativeTime else self._absoluteClock
self._relativeClockFormat = "%.6f" if microsecondPrecision else "%.3f"
self._minimumLevel = logging.INFO if noDebug else logging.DEBUG
self._minimumLevel = self._min_level(min_level, noDebug)
Copy link
Contributor

Choose a reason for hiding this comment

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

why would you pass both of the parameters and not decide on min-level before the init? think that would be cleaner

noDebug=args.noDebug, relativeTime=args.relativeTime, noColors=args.noColors,
microsecondPrecision=args.microsecondPrecision, showFullPaths=args.showFullPaths,
withThreads=args.withThreads, utc=args.utc)
withThreads=args.withThreads, utc=args.utc, min_level=args.min_level)
Copy link
Contributor

Choose a reason for hiding this comment

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

camel case it please


formatter = Formatter(
noDebug=args.noDebug, relativeTime=args.relativeTime, noColors=args.noColors,
minimumLevel=min_level(args.min_level, args.noDebug), relativeTime=args.relativeTime, noColors=args.noColors,
Copy link
Contributor

Choose a reason for hiding this comment

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

camel case

@sergey-stratoscale
Copy link
Contributor

ship it

@segev-lior segev-lior force-pushed the lior/min-level branch 2 times, most recently from dfebcca to c052488 Compare October 18, 2016 14:13
parser = argparse.ArgumentParser()
parser.add_argument("logFiles", metavar='logFile', nargs='*', help='logfiles to read')
parser.add_argument('-d', "--noDebug", action='store_true', help='filter out debug messages')
parser.add_argument('-l', '--min-level', action='store', default='', help='minimal log level to display (substring is OK, case-insensitive)')

Choose a reason for hiding this comment

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

curios: why not defining -v / --verbose with action=count (see: https://docs.python.org/2/library/argparse.html#action)?
this way every occurrence of -v will increase the logging level to display.

@segev-lior segev-lior merged commit fa8686e into master Dec 8, 2016
@segev-lior segev-lior deleted the lior/min-level branch December 8, 2016 11:56
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.

3 participants