Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace console.log with structured logging #508

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
b0eb1b4
feat: add in Winston logger and replace console.logs with relevant lo…
LewisBroadhurst Mar 4, 2024
3548464
feat: auto-formatting
LewisBroadhurst Mar 4, 2024
4ab7b53
feat: change folder name to allow logger.js to be committed
LewisBroadhurst Mar 9, 2024
09f5a9e
Fix paths for logger
LewisBroadhurst Mar 28, 2024
f85483a
More logging module path fixes
LewisBroadhurst Mar 28, 2024
3bf39a9
feat: requirement for non ES6 import for logger
LewisBroadhurst Mar 28, 2024
d9d26fb
feat: remove logger from ui
LewisBroadhurst Mar 28, 2024
20637b0
feat: remove logger from ui
LewisBroadhurst Mar 28, 2024
dca1ed4
Merge branch 'main' into structured-logging
LewisBroadhurst Mar 28, 2024
dccdc78
feat: fix up imports and make logger into a module
LewisBroadhurst Mar 29, 2024
ef3cf62
feat: add better formatting to log
LewisBroadhurst Mar 30, 2024
4e443f8
feat: add better formatting to logs
LewisBroadhurst Mar 30, 2024
059e76f
feat: change log filename
LewisBroadhurst Mar 30, 2024
a3b6b67
Merge branch 'main' into structured-logging
LewisBroadhurst Mar 30, 2024
b1c2381
feat: fix more imports
LewisBroadhurst Mar 30, 2024
c707785
feat: test...
LewisBroadhurst Mar 30, 2024
e6a0e51
fix: improvement to logs and fix for 'Unknown logger level: host' error
LewisBroadhurst Mar 30, 2024
d8b538c
fix: remove test file and fix typo
LewisBroadhurst Mar 30, 2024
af52a50
fix: more log import fixing
LewisBroadhurst Mar 30, 2024
9c161c9
fix: linter change
LewisBroadhurst Mar 30, 2024
c955e73
Merge branch 'main' into structured-logging
JamieSlome Apr 5, 2024
6e44a7c
fix: remove console.log from internal tooling
LewisBroadhurst Apr 6, 2024
fcf61a8
fix: remove logger import
LewisBroadhurst Apr 6, 2024
fc6a6f2
Merge branch 'structured-logging' of https://github.com/LewisBroadhur…
LewisBroadhurst Apr 6, 2024
7bfae3a
test: began adding testing for git-proxy.log
LewisBroadhurst Apr 6, 2024
03fbbc7
feat: ...
LewisBroadhurst Apr 6, 2024
9bdaec1
feat: logging func tests
LewisBroadhurst Apr 7, 2024
1a20bf1
feat: logging func tests
LewisBroadhurst Apr 7, 2024
f1d2f4d
Merge branch 'main' into structured-logging
LewisBroadhurst Apr 7, 2024
df48552
feat: combine console/winston logging
LewisBroadhurst Apr 8, 2024
3f1698c
Merge branch 'structured-logging' of https://github.com/LewisBroadhur…
LewisBroadhurst Apr 8, 2024
a885b1b
fix: add logger line
LewisBroadhurst Apr 8, 2024
94499b5
fix: test commit
LewisBroadhurst Apr 8, 2024
eecb957
feat: ...
LewisBroadhurst Apr 8, 2024
dc2672f
chore: remove test commit line
LewisBroadhurst Apr 8, 2024
d7a0c32
chore: remove test commit line
LewisBroadhurst Apr 8, 2024
3dbf6fa
feat: alternative logger with filename
LewisBroadhurst Apr 11, 2024
3b44195
fix: work out how to add filenames into logger without custom wrapper
LewisBroadhurst Apr 23, 2024
8b03c6c
chore: linting
LewisBroadhurst Apr 23, 2024
7ffe660
feat: merge in latest main branch and change console.logs
LewisBroadhurst May 6, 2024
3869f4e
feat: more console.log -> logger.info changes
LewisBroadhurst May 6, 2024
520c5a5
Merge branch 'main' into structured-logging
JamieSlome May 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env node
/* eslint-disable max-len */
const { logger } = require('./src/logging/index');

const argv = require('yargs/yargs')(process.argv.slice(2))
.usage('Usage: $0 [options]')
.options({
Expand All @@ -25,14 +27,14 @@ if (argv.v) {
const fs = require('fs');

if (!fs.existsSync(config.configFile)) {
console.error(
logger.error(
`Config file ${config.configFile} doesn't exist, nothing to validate! Did you forget -c/--config?`,
);
process.exit(1);
}

config.validate();
console.log(`${config.configFile} is valid`);
logger.info(`${config.configFile} is valid`);
process.exit(0);
}

Expand Down
3 changes: 2 additions & 1 deletion nyc.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const { logger } = require('./src/logging/index');
const opts = {
branches: 80,
lines: 80,
functions: 80,
statements: 80,
};

console.log('nyc config: ', opts);
logger.info(`nyc config: ${opts}`);
module.exports = opts;
176 changes: 172 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"react-html-parser": "^2.0.2",
"react-router-dom": "6.23.0",
"uuid": "^9.0.0",
"winston": "^3.12.0",
"yargs": "^17.7.2"
},
"devDependencies": {
Expand Down
Loading
Loading