<commit_before>package main

import (
	"os"
	"strings"

	"github.com/codegangsta/cli"

	"github.intel.com/hpdd/applog"
	"github.intel.com/hpdd/liblog"
)

var commands []cli.Command
var version string // Set by build environment

func main() {
	app := cli.NewApp()
	app.Usage = "Data Movement Control for Lustre* software"
	app.Commands = commands
	app.Version = version
	app.Authors = []cli.Author{
		{
			Name:  "Intel® Enterprise Edition for Lustre* software Team",
			Email: "<EMAIL>",
		},
	}
	app.Flags = []cli.Flag{
		cli.BoolFlag{
			Name:  "debug",
			Usage: "Display debug logging to console",
		},
		cli.StringFlag{
			Name:  "logfile, l",
			Usage: "Log tool activity to this file",
			Value: "",
		},
	}
	app.Before = configureLogging
	if err := app.Run(os.Args); err != nil {
		applog.Fail(err)
	}
}

func configureLogging(c *cli.Context) error {
	if c.Bool("debug") {
		applog.SetLevel(applog.DEBUG)
		liblog.Enable()
	}
	applog.SetJournal(c.String("logfile"))
	liblog.SetWriter(applog.Writer("liblog"))

	return nil
}

func logContext(c *cli.Context) {
	for {
		if c.Parent() == nil {
			break
		}
		c = c.Parent()
	}

	applog.Debug("Context: %s", strings.Join(c.Args(), " "))
}
<commit_msg>Update ldmc call to applog.Writer()<commit_after>package main

import (
	"os"
	"strings"

	"github.com/codegangsta/cli"

	"github.intel.com/hpdd/applog"
	"github.intel.com/hpdd/liblog"
)

var commands []cli.Command
var version string // Set by build environment

func main() {
	app := cli.NewApp()
	app.Usage = "Data Movement Control for Lustre* software"
	app.Commands = commands
	app.Version = version
	app.Authors = []cli.Author{
		{
			Name:  "Intel® Enterprise Edition for Lustre* software Team",
			Email: "<EMAIL>",
		},
	}
	app.Flags = []cli.Flag{
		cli.BoolFlag{
			Name:  "debug",
			Usage: "Display debug logging to console",
		},
		cli.StringFlag{
			Name:  "logfile, l",
			Usage: "Log tool activity to this file",
			Value: "",
		},
	}
	app.Before = configureLogging
	if err := app.Run(os.Args); err != nil {
		applog.Fail(err)
	}
}

func configureLogging(c *cli.Context) error {
	if c.Bool("debug") {
		applog.SetLevel(applog.DEBUG)
		liblog.Enable()
	}
	applog.SetJournal(c.String("logfile"))
	liblog.SetWriter(applog.Writer().Prefix("liblog"))

	return nil
}

func logContext(c *cli.Context) {
	for {
		if c.Parent() == nil {
			break
		}
		c = c.Parent()
	}

	applog.Debug("Context: %s", strings.Join(c.Args(), " "))
}

{'fraction_non_alphanumeric': 0.16209578387228818, 'fraction_numerical': 0.0, 'mean_word_length': 3.5512104283054002, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4691327', 'n_tokens_mistral': 1005, 'n_tokens_neox': 925, 'n_words': 206}