<commit_before>package main

import (
	"fmt"
	"io"
	"os"

	"github.com/docker/docker/pkg/jsonmessage"
	"github.com/docker/docker/pkg/term"
)

var cmdLog = &Command{
	Run:      runLog,
	Usage:    "log",
	NeedsApp: true,
	Category: "app",
	Short:    "stream app log lines",
	Long: `
Log prints the streaming application log.
   Examples:
    $ emp log -a acme-inc
    2013-10-17T00:17:35.066089+00:00 app[web.1]: Completed 302 Found in 0ms
    ...
`,
}

func runLog(cmd *Command, args []string) {
	if len(args) != 0 {
		cmd.PrintUsage()
		os.Exit(2)
	}

	r, w := io.Pipe()
	appName := mustApp()
	endpoint := fmt.Sprintf("/apps/%s/log-sessions", appName)

	go func() {
		must(client.Post(w, endpoint, nil))
		must(w.Close())
	}()

	outFd, isTerminalOut := term.GetFdInfo(os.Stdout)
	must(jsonmessage.DisplayJSONMessagesStream(r, os.Stdout, outFd, isTerminalOut))
}<commit_msg>Just print raw text to stdout.<commit_after>package main

import (
	"fmt"
	"os"
)

var cmdLog = &Command{
	Run:      runLog,
	Usage:    "log",
	NeedsApp: true,
	Category: "app",
	Short:    "stream app log lines",
	Long: `
Log prints the streaming application log.
   Examples:
    $ emp log -a acme-inc
    2013-10-17T00:17:35.066089+00:00 app[web.1]: Completed 302 Found in 0ms
    ...
`,
}

func runLog(cmd *Command, args []string) {
	if len(args) != 0 {
		cmd.PrintUsage()
		os.Exit(2)
	}

	appName := mustApp()
	endpoint := fmt.Sprintf("/apps/%s/log-sessions", appName)

	must(client.Post(os.Stdout, endpoint, nil))
}
{'fraction_non_alphanumeric': 0.16265060240963855, 'fraction_numerical': 0.041499330655957165, 'mean_word_length': 3.4894894894894897, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '3116998', 'n_tokens_mistral': 644, 'n_tokens_neox': 590, 'n_words': 137}