-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
122 additions
and
105 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
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,3 +1,3 @@ | ||
export * from './formatting/index.js'; | ||
export * from './logging/index.js'; | ||
export * from './loggage/index.js'; | ||
export * from './typings/index.js'; |
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,2 @@ | ||
export * from './loggage.js'; | ||
export * from './tags.js' |
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,4 @@ | ||
import { B } from '../formatting/background.js'; | ||
import { S } from '../formatting/style.js'; | ||
import { Verbosity } from '../typings/loggage.js'; | ||
|
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { describe, it } from 'node:test'; | ||
import { Loggage, Verbosity } from '../index.js'; | ||
import { strict as assert } from 'node:assert'; | ||
|
||
describe('Test Loggage', () => { | ||
it('should set the verbosity level correctly', () => { | ||
const loggage = new Loggage({ name: 'My Project', verbosity: Verbosity.INFO, save: false }); | ||
assert.equal(loggage.getVerbosity(), Verbosity.INFO); | ||
|
||
loggage.setVerbosity(Verbosity.DEBUG); | ||
assert.equal(loggage.getVerbosity(), Verbosity.DEBUG); | ||
}); | ||
|
||
it('should set the name correctly', () => { | ||
const loggage = new Loggage({ name: 'My Project', verbosity: Verbosity.INFO, save: false }); | ||
assert.equal(loggage.getName(), 'My Project'); | ||
|
||
loggage.setName('newName'); | ||
assert.equal(loggage.getName(), 'newName'); | ||
}); | ||
|
||
it('should set the log to file correctly', () => { | ||
const loggage = new Loggage({ name: 'My Project', verbosity: Verbosity.INFO, save: false }); | ||
assert.equal(loggage.getSaveToFile(), false); | ||
|
||
loggage.setSaveToFile(true); | ||
assert.equal(loggage.getSaveToFile(), true); | ||
}); | ||
|
||
|
||
it('should send the correct error message', () => { | ||
const loggage = new Loggage({ name: 'My Project', verbosity: Verbosity.INFO, save: false }); | ||
|
||
loggage.error('This is an error message'); | ||
}); | ||
|
||
it('should send the correct fatal error message', () => { | ||
const loggage = new Loggage({ name: 'My Project', verbosity: Verbosity.FATAL_ERROR, save: false }); | ||
|
||
loggage.fatal_error('This is an error message'); | ||
}); | ||
|
||
it('should send the correct warning message', () => { | ||
const loggage = new Loggage({ name: 'My Project', verbosity: Verbosity.INFO, save: false }); | ||
|
||
loggage.warning('This is a warning message'); | ||
}); | ||
|
||
it('should send the correct info message', () => { | ||
const loggage = new Loggage({ name: 'My Project', verbosity: Verbosity.INFO, save: false }); | ||
|
||
loggage.info('This is an info message'); | ||
}); | ||
|
||
it('should send the correct debug message', () => { | ||
const loggage = new Loggage({ name: 'My Project', verbosity: Verbosity.DEBUG, save: false }); | ||
|
||
loggage.debug('This is a debug message'); | ||
}); | ||
|
||
it('should send the correct verbose message', () => { | ||
const loggage = new Loggage({ name: 'My Project', verbosity: Verbosity.VERBOSE, save: false }); | ||
|
||
loggage.verbose('This is a verbose message'); | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from './logging.js'; | ||
export * from './loggage.js'; |
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