Skip to content

Commit

Permalink
feat: add lib and node version to debug (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo4815162342 committed May 5, 2022
1 parent 3386b72 commit 51b69a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cli/index.ts
Expand Up @@ -19,6 +19,7 @@ import debug from 'debug';
import { Output } from '../output-formatter/types';
import { Timeframe } from '../config/timeframes';
import { GOALS, trackCustomGoal } from '../analytics';
import { version } from '../../package.json';

const DEBUG_NAMESPACE = 'dukascopy-node:cli';

Expand Down Expand Up @@ -61,6 +62,7 @@ const filePath = resolve(folderPath, fileName);
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
(async () => {
try {
debug(`${DEBUG_NAMESPACE}:version`)(`${version} (node ${process.version})`);
debug(`${DEBUG_NAMESPACE}:config`)('%O', {
input,
isValid,
Expand Down
4 changes: 4 additions & 0 deletions src/getHistoricRates.ts
Expand Up @@ -20,6 +20,8 @@ import { GOALS, trackCustomGoal } from './analytics';
import { ArrayItem, ArrayTickItem, JsonItem, JsonItemTick, Output } from './output-formatter/types';
import { NotifyFn } from './buffer-fetcher/types';

import { version } from '../package.json';

import debug from 'debug';

const DEBUG_NAMESPACE = 'dukascopy-node';
Expand All @@ -32,6 +34,8 @@ export async function getHistoricRates(config: ConfigCsvItem): Promise<string>;
export async function getHistoricRates(config: Config): Promise<Output>;

export async function getHistoricRates(config: Config): Promise<Output> {
debug(`${DEBUG_NAMESPACE}:version`)(`${version} (node ${process.version})`);

const { input, isValid, validationErrors } = validateConfigNode(config);

debug(`${DEBUG_NAMESPACE}:config`)('%O', {
Expand Down

0 comments on commit 51b69a0

Please sign in to comment.