Skip to content

Commit

Permalink
Utilise le framework de log Diary
Browse files Browse the repository at this point in the history
(https://github.com/maraisr/diary?tab=readme-ov-file#-benchmark)

Il s'agit d'une première étape, on mettra un logger un peu plus sophistiqué dès
qu'on en aura trouvé un qui nous plaît.

Co-authored-by: Emmanuel Gaillot <[email protected]>
  • Loading branch information
Fabinout and egaillot committed Jul 4, 2024
1 parent 22b3013 commit a29f07e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
6 changes: 6 additions & 0 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 @@ -20,6 +20,7 @@
"dependencies": {
"axios": "^1.6.0",
"cookie-session": "^2.1.0",
"diary": "^0.4.5",
"express": "^4.19.2",
"jose": "^5.2.0",
"nodemon": "^3.0.1",
Expand Down
2 changes: 2 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const fabriqueSessionFCPlus = new FabriqueSessionFCPlus({
});
const middleware = new Middleware({ adaptateurChiffrement, adaptateurEnvironnement });

journal.active();

const serveur = SiteVitrine.creeServeur({
adaptateurChiffrement,
adaptateurEnvironnement,
Expand Down
9 changes: 5 additions & 4 deletions src/adaptateurs/journal.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable no-console */
const consigne = console.log;
/* eslint-enable no-console */
const { enable, info } = require('diary');

module.exports = { consigne };
const active = () => enable('*');
const consigne = info;

module.exports = { active, consigne };

0 comments on commit a29f07e

Please sign in to comment.