Skip to content

WiP - Add --noTimestamp arg #78

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- `--rawString` Print JSON strings instead of escaping ("\n", ...)
- `--invert` Invert white colors to black for light color schemes
- `--raw`, or `--pretty`, for `watch` and `get` commands respectively, toggles display of the timestamp and stream name prefix.
- `--noTimestamp` to supress only the timestamp, but not the stream name prefix

- Filter logs using CloudWatch patterns
- `--filter foo` Filter logs for the text "foo"
Expand Down
1 change: 1 addition & 0 deletions cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".`,
getCommand.Flags().BoolVar(&getOutputConfig.Expand, "expand", false, "indent JSON log messages")
getCommand.Flags().BoolVar(&getOutputConfig.Invert, "invert", false, "invert colors for light terminal themes")
getCommand.Flags().BoolVar(&getOutputConfig.RawString, "rawString", false, "print JSON strings without escaping")
getCommand.Flags().BoolVar(&watchOutputConfig.NoTimestamp, "noTimestamp", false, "print log without timestamp")
}
1 change: 1 addition & 0 deletions cmd/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ func init() {
watchCommand.Flags().BoolVar(&watchOutputConfig.Expand, "expand", false, "indent JSON log messages")
watchCommand.Flags().BoolVar(&watchOutputConfig.Invert, "invert", false, "invert colors for light terminal themes")
watchCommand.Flags().BoolVar(&watchOutputConfig.RawString, "rawString", false, "print JSON strings without escaping")
watchCommand.Flags().BoolVar(&watchOutputConfig.NoTimestamp, "noTimestamp", false, "print log without timestamp")
}
5 changes: 5 additions & 0 deletions config/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type OutputConfiguration struct {
Invert bool
RawString bool
NoColor bool
NoTimestamp bool
}

func (c *OutputConfiguration) Formatter() *colorjson.Formatter {
Expand All @@ -33,5 +34,9 @@ func (c *OutputConfiguration) Formatter() *colorjson.Formatter {
color.NoColor = true
}

if c.NoTimestamp {
formatter.NoTimestamp = true
}

return formatter
}