'use strict';

var printf = require('../../_virtual/printf.js');
require('../triple-beam/index.js');
var index = require('../../_virtual/index12.js');

var hasRequiredPrintf;

function requirePrintf () {
	if (hasRequiredPrintf) return printf.__module.exports;
	hasRequiredPrintf = 1;

	const { MESSAGE } = index.__exports;

	class Printf {
	  constructor(templateFn) {
	    this.template = templateFn;
	  }

	  transform(info) {
	    info[MESSAGE] = this.template(info);
	    return info;
	  }
	}

	/*
	 * function printf (templateFn)
	 * Returns a new instance of the printf Format that creates an
	 * intermediate prototype to store the template string-based formatter
	 * function.
	 */
	printf.__module.exports = opts => new Printf(opts);

	printf.__module.exports.Printf
	  = printf.__module.exports.Format
	  = Printf;
	return printf.__module.exports;
}

exports.__require = requirePrintf;
