summaryrefslogtreecommitdiffhomepage
path: root/logtail/buffer.go
AgeCommit message (Collapse)AuthorFilesLines
2025-09-29feature/logtail: pull logtail + netlog out to modular featuresBrad Fitzpatrick1-0/+2
Removes 434 KB from the minimal Linux binary, or ~3%. Primarily this comes from not linking in the zstd encoding code. Fixes #17323 Change-Id: I0a90de307dfa1ad7422db7aa8b1b46c782bfaaf7 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-04-08logtail: require Buffer.Write to not retain the provided slice (#11617)Joe Tsai1-3/+3
Buffer.Write has the exact same signature of io.Writer.Write. The latter requires that implementations to never retain the provided input buffer, which is an expectation that most users will have when they see a Write signature. The current behavior of Buffer.Write where it does retain the input buffer is a risky precedent to set. Switch the behavior to match io.Writer.Write. There are only two implementations of Buffer in existence: * logtail.memBuffer * filch.Filch The former can be fixed by cloning the input to Write. This will cause an extra allocation in every Write, but we can fix that will pooling on the caller side in a follow-up PR. The latter only passes the input to os.File.Write, which does respect the io.Writer.Write requirements. Updates #cleanup Updates tailscale/corp#18514 Signed-off-by: Joe Tsai <joetsai@digital-static.net>
2023-01-27all: update copyright and license headersWill Norris1-3/+2
This updates all source files to use a new standard header for copyright and license declaration. Notably, copyright no longer includes a date, and we now use the standard SPDX-License-Identifier header. This commit was done almost entirely mechanically with perl, and then some minimal manual fixes. Updates #6865 Signed-off-by: Will Norris <will@tailscale.com>
2022-08-03logtail, net/portmapper, wgengine/magicsock: use fmt.AppendfBrad Fitzpatrick1-4/+1
Fixes #5206 Change-Id: I490bb92e774ce7c044040537e2cd864fcf1dbe5a Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-07-27logtail,logpolicy: tweak minor cosmetic thingsBrad Fitzpatrick1-0/+2
Just reading the code again in prep for some alloc reductions. Change-Id: I065226ea794b7ec7144c2b15942d35131c9313a8 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-03-20logtail: rename the unused CheckLogs to DrainLogsDavid Crawshaw1-0/+3
Its semantics has changed slightly, this will let us use it to drive batched logging in special circumstances. Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
2020-02-09Move Linux client & common packages into a public repo.Earl Lee1-0/+82