<commit_before>import logAF from '../logAF';

/**
 * Sets logging options for the logAF method
 *
 * accepts an options object with the following optional properties:
 * - label (`Boolean`) - set to `false` to disable logging the location of calls to logAF
 * - duration (`Boolean`) - set to `false` to disable logging the time it takes (in secs) to complete each call to logAF
 * - labelFormat (`String`) - alters the format of logAF labels; choose between `file` (*default*), `path`, `parent`, `arrow`, or `custom`
 *
 * ```js
 * const promise = new Promise(resolve => setTimeout(
 *   () => resolve(1), 1000)
 * );
 * ```
 * **default logging**
 * ```js
 * logAF(promise, 2);
 * // @filename.js:212:9:
 * // 1 2
 * // in 0.998 secs
 * ```
 * **turn off label**
 * ```js
 * logAF.options({ label: false });
 * logAF(promise, 2);
 * // 1 2
 * // in 0.999 secs
 * ```
 * **turn off duration**
 * ```js
 * logAF.options({ duration: false });
 * logAF(promise, 2);
 * // @filename.js:212:9:
 * // 1 2
 * ```
 * **change labelFormat**
 * - file (*default*)
 * ```js
 * logAF.options({ labelFormat: file });
 * logAF(promise, 2);
 * // @filename.js:212:9:
 * // 1 2
 * // in 0.998 secs
 * ```
 * - path
 * ```js
 * logAF.options({ labelFormat: path });
 * logAF(promise, 2);
 * // @/Path/to/current/directory/filename.js:212:9:
 * // 1 2
 * // in 0.997 secs
 * ```
 * - parent
 * ```js
 * logAF.options({ labelFormat: parent });
 * logAF(promise, 2);
 * // @parentDirectory/filename.js:213:9:
 * // 1 2
 * // in 0.998 secs
 * ```
 * - arrow
 * ```js
 * logAF.options({ labelFormat: arrow });
 * logAF(promise, 2);
 * // ========================> 1 2
 * // in 0.999 secs
 * ```
 *
 * - custom (create your own labelFormat)
 *  - to set a custom labelFormat, first set it to a string starting with `'custom='`
 *  - after `custom=`, insert your desired format as a string (a string within a string)
 *
 * ```js
 * logAF.options({
 *  labelFormat: 'custom="I logged this:"'
 * });
 * logAF(promise, 2);
 * // I logged this: 1 2
 * // in 1.000 secs
 * ```
 *
 * - your custom format can also access location information as variables, including `file`, `path`, `parent`, `arrow`, `line`, and `col`
 *
 * e.g., to set the labelFormat to `file:line:col =>` you can use template literals
 * ```js
 * logAF.options({
 *  labelFormat: 'custom=`${file}:${line}:${col} =>`'
 * });
 * logAF(promise, 2);
 * // filename.js:212:9 => 1 2
 * // in 0.998 secs
 * ```
 *
 * and just to demonstrate all the location variables in one custom format
 * ```js
 * logAF.options({
 *   labelFormat: 'custom=`${arrow}\nline: ${line}\ncol: ${col}\nparent: ${parent}\nfile: ${file}\npath: ${path}\n`'
 * });
 * logAF(promise, 2);
 * // ========================><commit_msg>docs: remove code block indentation in logAfOptions<commit_after>import logAF from '../logAF';

/**
 * Sets logging options for the logAF method
 *
 * accepts an options object with the following optional properties:
 * - label (`Boolean`) - set to `false` to disable logging the location of calls to logAF
 * - duration (`Boolean`) - set to `false` to disable logging the time it takes (in secs) to complete each call to logAF
 * - labelFormat (`String`) - alters the format of logAF labels; choose between `file` (*default*), `path`, `parent`, `arrow`, or `custom`
 *
 * ```js
 * const promise = new Promise(resolve => setTimeout(
 *   () => resolve(1), 1000)
 * );
 * ```
 * **default logging**
 * ```js
 * logAF(promise, 2);
 * // @filename.js:212:9:
 * // 1 2
 * // in 0.998 secs
 * ```
 * **turn off label**
 * ```js
 * logAF.options({ label: false });
 * logAF(promise, 2);
 * // 1 2
 * // in 0.999 secs
 * ```
 * **turn off duration**
 * ```js
 * logAF.options({ duration: false });
 * logAF(promise, 2);
 * // @filename.js:212:9:
 * // 1 2
 * ```
 * **change labelFormat**
 *
 * &#9679; file (*default*)
 *
 * ```js
 * logAF.options({ labelFormat: file });
 * logAF(promise, 2);
 * // @filename.js:212:9:
 * // 1 2
 * // in 0.998 secs
 * ```
 * &#9679; path
 *
 * ```js
 * logAF.options({ labelFormat: path });
 * logAF(promise, 2);
 * // @/Path/to/current/directory/filename.js:212:9:
 * // 1 2
 * // in 0.997 secs
 * ```
 * &#9679; parent
 *
 * ```js
 * logAF.options({ labelFormat: parent });
 * logAF(promise, 2);
 * // @parentDirectory/filename.js:213:9:
 * // 1 2
 * // in 0.998 secs
 * ```
 * &#9679; arrow
 *
 * ```js
 * logAF.options({ labelFormat: arrow });
 * logAF(promise, 2);
 * // ========================> 1 2
 * // in 0.999 secs
 * ```
 *
 * &#9679; custom (create your own labelFormat)
 *  - to set a custom labelFormat, first set it to a string starting with `'custom='`
 *  - after `custom=`, insert your desired format as a string (a string within a string)
 *
 * ```js
 * logAF.options({
 *  labelFormat: 'custom="I logged this:"'
 * });
 * logAF(promise, 2);
 * // I logged this: 1 2
 * // in 1.000 secs
 * ```
 *
 * - your custom format can also access location information as variables, including `file`, `path`, `parent`, `arrow`, `line`, and `col`
 *
 * e.g., to set the labelFormat to `file:line:col =>` you can use template literals
 * ```js
 * logAF.options({
 *  labelFormat: 'custom=`${file}:${line}:${col} =>`'
 * });
 * logAF(promise, 2);
 * // filename.js:212:9 => 1 2
 * // in 0.998 secs
 * ```
 *
 * and just to demonstrate all the location variables in one custom format
 * ```js
 * logAF.options({
 *   labelFormat: 'custom=`${arrow}\nline: ${line}\ncol: ${col}\nparent: ${parent}\nfile: ${file}\npath: ${path}\n`'
 * });
 * logAF(promise, 2);
 * // ========================>
{'fraction_non_alphanumeric': 0.2196656480316376, 'fraction_numerical': 0.035592306309545206, 'mean_word_length': 3.202416918429003, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '2642491', 'n_tokens_mistral': 2033, 'n_tokens_neox': 1910, 'n_words': 579}