Skip to content

Commit

Permalink
feat: create logger and timedlog
Browse files Browse the repository at this point in the history
  • Loading branch information
Aerilym committed Jul 14, 2024
1 parent 3e46be4 commit 26951f4
Show file tree
Hide file tree
Showing 12 changed files with 708 additions and 4 deletions.
3 changes: 3 additions & 0 deletions apps/staking/lib/logger.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { initLogger } from '@session/util/logger';

export const logger = initLogger();
8 changes: 6 additions & 2 deletions apps/staking/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ const nextConfig = {
'@session/ui',
'@session/wallet',
'@session/contracts',
'@session/util',
'better-sqlite3-multiple-ciphers',
],
experimental: {
serverComponentsExternalPackages: ['pino', 'pino-pretty'],
},
webpack: (config) => {
config.externals.push('pino-pretty', 'lokijs', 'encoding');
return config;
Expand Down Expand Up @@ -56,8 +60,8 @@ const nextConfig = {
rewrites: async () => {
return [
{
source: '/api/sent/:path*',
destination: `${getSENTStakingApiUrl()}:path*`,
source: '/api/ssb/:path*',
destination: `${getSENTStakingApiUrl()}/:path*`,
},
];
},
Expand Down
2 changes: 2 additions & 0 deletions apps/staking/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
"date-fns": "^3.6.0",
"next": "^14.2.3",
"next-intl": "^3.14.1",
"pino": "^9.2.0",
"pino-pretty": "^11.2.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.51.5",
Expand Down
10 changes: 10 additions & 0 deletions packages/logger/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,
extends: ['@session/eslint-config/react-internal.js'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
};
1 change: 1 addition & 0 deletions packages/logger/.lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "*.js|*.jsx|*.ts|*.tsx": "eslint" }
5 changes: 5 additions & 0 deletions packages/logger/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* eslint-disable no-undef */
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
...require('@session/testing/config/jest.base.config'),
};
Loading

0 comments on commit 26951f4

Please sign in to comment.