Pull log 1.14.0 with it's no_net (no_http)#34
Merged
Conversation
…ly dependabot doesn't do it automatically
ccoVeille
reviewed
Jul 2, 2024
|
|
||
| ### Small binaries | ||
|
|
||
| If you application doesn't do http request/response logging at all, use `-tags no_http` or `-tags no_net` (that one will also imply `no_tls_fallback`) and save 1.6 Mbytes in your binary's size (because the linker isn't smart enough to see net/http isn't actually used) (1.1Mbytes for log's no_http and 530k from the no_tls_fallback) |
There was a problem hiding this comment.
Nonblocking:
For constituency I would use, a space plus sane units
Suggested change
| If you application doesn't do http request/response logging at all, use `-tags no_http` or `-tags no_net` (that one will also imply `no_tls_fallback`) and save 1.6 Mbytes in your binary's size (because the linker isn't smart enough to see net/http isn't actually used) (1.1Mbytes for log's no_http and 530k from the no_tls_fallback) | |
| If you application doesn't do http request/response logging at all, use `-tags no_http` or `-tags no_net` (that one will also imply `no_tls_fallback`) and save 1.6 Mbytes in your binary's size (because the linker isn't smart enough to see net/http isn't actually used) (1.1 Mbytes for log's no_http and 530 kbytes from the no_tls_fallback) |
or
Suggested change
| If you application doesn't do http request/response logging at all, use `-tags no_http` or `-tags no_net` (that one will also imply `no_tls_fallback`) and save 1.6 Mbytes in your binary's size (because the linker isn't smart enough to see net/http isn't actually used) (1.1Mbytes for log's no_http and 530k from the no_tls_fallback) | |
| If you application doesn't do http request/response logging at all, use `-tags no_http` or `-tags no_net` (that one will also imply `no_tls_fallback`) and save 1.6 MB in your binary's size (because the linker isn't smart enough to see net/http isn't actually used) (1.1 MB for log's no_http and 530 kB from the no_tls_fallback) |
|
|
||
| If you application doesn't do http request/response logging at all, use `-tags no_http` or `-tags no_net` (that one will also imply `no_tls_fallback`) and save 1.6 Mbytes in your binary's size (because the linker isn't smart enough to see net/http isn't actually used) (1.1Mbytes for log's no_http and 530k from the no_tls_fallback) | ||
|
|
||
| And, if you don't need any of the advanced JSON logging (which is quite likely with a cli), use `-tags no_json` the logger will still produce json structured logging just not as advanced if what you log are deep structures - this saves another 130k or so. |
There was a problem hiding this comment.
Suggested change
| And, if you don't need any of the advanced JSON logging (which is quite likely with a cli), use `-tags no_json` the logger will still produce json structured logging just not as advanced if what you log are deep structures - this saves another 130k or so. | |
| And, if you don't need any of the advanced JSON logging (which is quite likely with a cli), use `-tags no_json` the logger will still produce json structured logging just not as advanced if what you log are deep structures - this saves another 130 kB or so. |
or
Suggested change
| And, if you don't need any of the advanced JSON logging (which is quite likely with a cli), use `-tags no_json` the logger will still produce json structured logging just not as advanced if what you log are deep structures - this saves another 130k or so. | |
| And, if you don't need any of the advanced JSON logging (which is quite likely with a cli), use `-tags no_json` the logger will still produce JSON structured logging just not as advanced if what you log are deep structures - this saves another 130 kbytes or so. |
|
|
||
| These tags are from [fortio.org/log](https://github.com/fortio/log) v1.14 and later | ||
|
|
||
| In summary: for smallest pure local cli binaries using this package: |
There was a problem hiding this comment.
Suggested change
| In summary: for smallest pure local cli binaries using this package: | |
| In summary: for smallest pure local CLI binaries using this package: |
| ``` | ||
| CGO_ENABLE=0 go build -trimpath -ldflags="-w -s" -tags no_net,no_json . | ||
| ``` | ||
| saves ~1.7Mbytes in total (a basic cli dependending on this package will then only be about 300k more as an hello world yet include color help, buildinfo, version, logging etc) |
There was a problem hiding this comment.
Suggested change
| saves ~1.7Mbytes in total (a basic cli dependending on this package will then only be about 300k more as an hello world yet include color help, buildinfo, version, logging etc) | |
| saves ~1.7 Mbytes in total (a basic CLI dependending on this package will then only be about 300 kbytes more as an hello world yet include color help, buildinfo, version, logging etc) |
Suggested change
| saves ~1.7Mbytes in total (a basic cli dependending on this package will then only be about 300k more as an hello world yet include color help, buildinfo, version, logging etc) | |
| saves ~1.7 MB in total (a basic CLI dependending on this package will then only be about 300 kB more as an hello world yet include color help, buildinfo, version, logging etc) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://github.com/fortio/log/releases/tag/v1.14.0