Skip to content

Conversation

@dbarnett
Copy link
Contributor

@dbarnett dbarnett commented Apr 30, 2017

These changes help log handlers treat log entries as opaque data structures so maktaba can evolve the format as needed w/o having to coordinate versioning with callers. Entry format will be changed slightly in #103 after callers have a chance to migrate to this helper.

Note the "Not enough arguments" fallback could conceivably cause performance regressions until the callers are updated if there's a ton of logging, but I tried it out on a fairly heavy vim configuration with a lot of plugins and logging and I couldn't measure a reliable performance regression comparing time vim -c quit output with and without.

These changes help log handlers treat log entries as opaque data
structures so maktaba can evolve the format as needed w/o having to
coordinate versioning with callers. Entry format will be changed
slightly in #103 after callers have a chance to migrate to this helper.
Copy link
Member

@malcolmr malcolmr left a comment

Choose a reason for hiding this comment

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

LGTM

endtry
return printf('%s %s [%s] %s',
\ l:level_name,
\ strftime('%Y-%m-%d@%H:%M:%S', l:timestamp),
Copy link
Member

Choose a reason for hiding this comment

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

Consider using an ISO 8601 local date/time pattern? (e.g. '%Y-%m-%dT%H:%M:%S')?

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.

@dbarnett dbarnett force-pushed the log_formatentries branch from 3b84c2d to 1fb508a Compare May 4, 2017 03:26
@dbarnett dbarnett merged commit 02935bd into master May 4, 2017
@dbarnett dbarnett deleted the log_formatentries branch May 4, 2017 03:39
dbarnett added a commit that referenced this pull request May 8, 2017
Changes since 1.14.0:
  * Implement maktaba#buffer#GetVisualSelection helper (#132).
  * Implement maktaba#log#GetFormattedEntries and support 1-arg log
    handler (see #204).
  * Notify user for messages logged at WARN or above by default (#185).
  * Fix Syscall.CallAsync failing for complex commands (#205).
  * Preserve trailing slash in maktaba#path#Split and MakeRelative
    (#137 and #175).
  * Fix 'maxfuncdepth' error in maktaba#json#Parse corner case (#153).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants