Skip to content

Commit

Permalink
fix codefactor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelcoxon committed Feb 8, 2024
1 parent efcde22 commit 9fbb57f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 32 deletions.
28 changes: 1 addition & 27 deletions src/Logging/ConsoleLogger.spec.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,7 @@


import { assert } from 'console';
import { IConsole } from '../IConsole';
import ConsoleLogger from './ConsoleLogger';
import { mock } from 'node:test';
import { LogLevel } from './_types';

const ___consoleImpl: IConsole = {
log(message, ...optionalParams)
{

},
error(message, ...optionalParams)
{

},
info(message, ...optionalParams)
{

},
trace(message, ...optionalParams)
{

},
warn(message, ...optionalParams)
{

}
};


describe("ConsoleLogger.constructor", () =>
Expand All @@ -45,7 +19,7 @@ describe("ConsoleLogger.log", () =>
it("should always log", () =>
{
const consoleImpl: IConsole = {
log: jest.fn((message, ...optionalParams) => { })
log: jest.fn(_ => { })
};

const actual = new ConsoleLogger(consoleImpl, {
Expand Down
4 changes: 2 additions & 2 deletions src/Logger.spec.ts → src/Logging/Logger.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { LogLevel } from '../src/Logging/_types';
import testLogVerbosity from './Logging/utils/testLogVerbosity';
import { LogLevel } from './_types';
import testLogVerbosity from './utils/testLogVerbosity';

function testLogVerbosityTest(expected: boolean, desiredLevel: LogLevel, loggingVerbosity: LogLevel)
{
Expand Down
1 change: 0 additions & 1 deletion src/Logging/Logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import testLogVerbosity from "./utils/testLogVerbosity";
import ScopedLogger from "./ScopedLogger";
import { IDisposable } from '../Types';
import errorAndMessageToString from './utils/errorAndMessageToString';
import { NullLogger, getDefaultLogger } from './utils/defaultLogger';

const defaultConfig: ILoggerConfig = {
loggingVerbosity: LogLevel.Info,
Expand Down
4 changes: 2 additions & 2 deletions src/loggerScope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { ILogger } from './Logging/_types';
* Decorator for setting the logger scope of an ILogger instance
* @param name
*/
export default function loggerScope(name: string): (target: Record<string, any>, key: string) => void
export default function loggerScope(name: string): (target: Record<string, unknown>, key: string) => void
{
return (target: Record<string, any>, key: string) =>
return (target: Record<string, unknown>, key: string) =>
{
const logger = target[key] as ILogger;
if (!logger)
Expand Down

0 comments on commit 9fbb57f

Please sign in to comment.