Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
17 changed files
with
1,143 additions
and
1,057 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
"simplegit", | ||
"lcov", | ||
"toolbelt", | ||
"Conosla", | ||
"packument" | ||
], | ||
"ignorePaths": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,5 @@ typings/ | |
# stryker temp files | ||
.stryker-tmp | ||
/reports | ||
!@types/** | ||
!/tools | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { LogLevel as ConsolaLogLevel } from 'consola'; | ||
import { LogLevel } from '../interfaces/ILogger'; | ||
|
||
const logLevelMap = { | ||
[LogLevel.ERROR]: ConsolaLogLevel.Error, | ||
[LogLevel.WARN]: ConsolaLogLevel.Warn, | ||
[LogLevel.LOG]: ConsolaLogLevel.Log, | ||
[LogLevel.INFO]: ConsolaLogLevel.Info, | ||
[LogLevel.DEBUG]: ConsolaLogLevel.Debug, | ||
[LogLevel.TRACE]: ConsolaLogLevel.Trace, | ||
[LogLevel.SILENT]: -ConsolaLogLevel.Silent, // Hack until the issue of fixed | ||
}; | ||
|
||
export const getConoslaLogLevel = (level: LogLevel): ConsolaLogLevel => logLevelMap[level]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { LogLevel } from './ILogger'; | ||
|
||
export abstract class ILoggerSettings { | ||
public abstract readonly debugMode: boolean; | ||
public abstract readonly traceMode: boolean; | ||
public abstract readonly logLevel: LogLevel | undefined; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { LoggerFactory } from '../../src/utils/logger/impl/loggerFactory'; | ||
import { ILoggerFactory, ILoggerSettings } from '../../src/utils/logger'; | ||
import { LogLevel } from '../../src/utils/logger/interfaces/ILogger'; | ||
|
||
export const loggerSettings: ILoggerSettings = { | ||
debugMode: true, | ||
traceMode: true, | ||
logLevel: LogLevel.TRACE, | ||
}; | ||
export const loggerFactory: ILoggerFactory = new LoggerFactory(loggerSettings); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { LogLevel } from '../../../../../src/utils/logger/interfaces/ILogger'; | ||
import { LogLevel as ConsolaLogLevel } from 'consola'; | ||
import { getConoslaLogLevel } from '../../../../../src/utils/logger/impl/logLevel'; | ||
|
||
describe(`log level`, () => { | ||
describe(`get conosla log level`, () => { | ||
it(`Should have proper mappings`, () => { | ||
expect(getConoslaLogLevel(LogLevel.ERROR)).toEqual(ConsolaLogLevel.Error); | ||
expect(getConoslaLogLevel(LogLevel.WARN)).toEqual(ConsolaLogLevel.Warn); | ||
expect(getConoslaLogLevel(LogLevel.LOG)).toEqual(ConsolaLogLevel.Log); | ||
expect(getConoslaLogLevel(LogLevel.INFO)).toEqual(ConsolaLogLevel.Info); | ||
expect(getConoslaLogLevel(LogLevel.DEBUG)).toEqual(ConsolaLogLevel.Debug); | ||
expect(getConoslaLogLevel(LogLevel.TRACE)).toEqual(ConsolaLogLevel.Trace); | ||
expect(getConoslaLogLevel(LogLevel.SILENT)).toEqual(-ConsolaLogLevel.Silent); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.