<commit_before>logplexc
========

Golang Wrapper for Logplex

This library handles some of the details in interactions with
[Logplex](https://github.com/heroku/logplex) for the purpose of
emitting logs.

One might use it something like this:

```go
	package main

	import (
	       "fmt"
	       "logplexc"
	       "time"
	)

	// Set up Logplex Client
	cfg := logplexc.Config{
		Logplex:    *logplexUrl,
		Token:      *logplexToken,
		HttpClient: *http.DefaultClient,
		Transport: http.Transport{},
	}

	cl := logplexc.NewClient(&cfg)
	procId := "Pid, or whatever"
	stats := client.BufferMessage(time.Now(), procId, []byte(messageBytes))
	// (Buffer more messages as one sees fit)

	// .BufferMessage and .Statistics returns statistics for
	// monitoring or deciding when to begin a Post.
	fmt.Printf("Framed: %d\n", stats.NumberFramed)

	resp, err := cl.PostMessages()
	if err != nil {
		fmt.Printf("Error: %v\n", err)
	}

	// Must close resp.Body
	resp.Body.Close()
```

PostMessages() is synchronous and slow.  It is also intended to be
safe under concurrent access (see bSwapLock) so that with only brief
contention one can also call BufferMessage in parallel.<commit_msg>Amend README to take into account removed Transport field<commit_after>logplexc
========

Golang Wrapper for Logplex

This library handles some of the details in interactions with
[Logplex](https://github.com/heroku/logplex) for the purpose of
emitting logs.

One might use it something like this:

```go
	package main

	import (
	       "fmt"
	       "logplexc"
	       "time"
	)

	// Set up Logplex Client
	cfg := logplexc.Config{
		Logplex:    *logplexUrl,
		Token:      *logplexToken,
		HttpClient: *http.DefaultClient,
	}

	cl := logplexc.NewClient(&cfg)
	procId := "Pid, or whatever"
	stats := client.BufferMessage(time.Now(), procId, []byte(messageBytes))
	// (Buffer more messages as one sees fit)

	// .BufferMessage and .Statistics returns statistics for
	// monitoring or deciding when to begin a Post.
	fmt.Printf("Framed: %d\n", stats.NumberFramed)

	resp, err := cl.PostMessages()
	if err != nil {
		fmt.Printf("Error: %v\n", err)
	}

	// Must close resp.Body
	resp.Body.Close()
```

PostMessages() is synchronous and slow.  It is also intended to be
safe under concurrent access (see bSwapLock) so that with only brief
contention one can also call BufferMessage in parallel.
{'fraction_non_alphanumeric': 0.11374207188160676, 'fraction_numerical': 0.0, 'mean_word_length': 3.65748031496063, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3154164', 'n_tokens_mistral': 771, 'n_tokens_neox': 737, 'n_words': 259}