Compare commits
10 Commits
d3e2b3e601
...
1a883193d0
Author | SHA1 | Date | |
---|---|---|---|
1a883193d0 | |||
78b1970ba9 | |||
746d5dff96 | |||
8780ea8e63 | |||
8911eed0fb | |||
1a3652472e | |||
2e62577103 | |||
653e77160b | |||
3898a6bf4f | |||
448cf1569b |
17
README.md
17
README.md
@ -40,6 +40,23 @@ cd front
|
||||
pnpm run unlink_kar_cw
|
||||
```
|
||||
|
||||
Tools in production mode
|
||||
========================
|
||||
|
||||
Changing the Log Level
|
||||
----------------------
|
||||
|
||||
In a production environment, you can adjust the log level to help diagnose bugs more effectively.
|
||||
|
||||
The available log levels are:
|
||||
| **Log Level Tag** | **org.kar.karusic** | **org.kar.archidata** | **other** |
|
||||
| ----------------- | ------------------- | --------------------- | --------- |
|
||||
| `prod` | INFO | INFO | INFO |
|
||||
| `prod-debug` | DEBUG | INFO | INFO |
|
||||
| `prod-trace` | TRACE | DEBUG | INFO |
|
||||
| `prod-trace-full` | TRACE | TRACE | INFO |
|
||||
| `dev` | TRACE | DEBUG | INFO |
|
||||
|
||||
|
||||
Manual set in production:
|
||||
=========================
|
||||
|
@ -20,7 +20,7 @@
|
||||
<dependency>
|
||||
<groupId>kangaroo-and-rabbit</groupId>
|
||||
<artifactId>archidata</artifactId>
|
||||
<version>0.20.4</version>
|
||||
<version>0.21.0</version>
|
||||
</dependency>
|
||||
<!-- Loopback of logger JDK logging API to SLF4J -->
|
||||
<dependency>
|
||||
@ -39,6 +39,11 @@
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
<version>2.12.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.janino</groupId>
|
||||
<artifactId>janino</artifactId>
|
||||
<version>3.1.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
|
@ -1,60 +0,0 @@
|
||||
package org.kar.karusic.internal;
|
||||
|
||||
//import io.scenarium.logger.LogLevel;
|
||||
//import io.scenarium.logger.Logger;
|
||||
|
||||
public class Log {
|
||||
// private static final String LIB_NAME = "logger";
|
||||
// private static final String LIB_NAME_DRAW = Logger.getDrawableName(LIB_NAME);
|
||||
// private static final boolean PRINT_CRITICAL = Logger.getNeedPrint(LIB_NAME, LogLevel.CRITICAL);
|
||||
// private static final boolean PRINT_ERROR = Logger.getNeedPrint(LIB_NAME, LogLevel.ERROR);
|
||||
// private static final boolean PRINT_WARNING = Logger.getNeedPrint(LIB_NAME, LogLevel.WARNING);
|
||||
// private static final boolean PRINT_INFO = Logger.getNeedPrint(LIB_NAME, LogLevel.INFO);
|
||||
// private static final boolean PRINT_DEBUG = Logger.getNeedPrint(LIB_NAME, LogLevel.DEBUG);
|
||||
// private static final boolean PRINT_VERBOSE = Logger.getNeedPrint(LIB_NAME, LogLevel.VERBOSE);
|
||||
// private static final boolean PRINT_TODO = Logger.getNeedPrint(LIB_NAME, LogLevel.TODO);
|
||||
// private static final boolean PRINT_PRINT = Logger.getNeedPrint(LIB_NAME, LogLevel.PRINT);
|
||||
//
|
||||
// private Log() {}
|
||||
//
|
||||
// public static void print(String data) {
|
||||
// if (PRINT_PRINT)
|
||||
// Logger.print(LIB_NAME_DRAW, data);
|
||||
// }
|
||||
//
|
||||
// public static void todo(String data) {
|
||||
// if (PRINT_TODO)
|
||||
// Logger.todo(LIB_NAME_DRAW, data);
|
||||
// }
|
||||
//
|
||||
// public static void critical(String data) {
|
||||
// if (PRINT_CRITICAL)
|
||||
// Logger.critical(LIB_NAME_DRAW, data);
|
||||
// }
|
||||
//
|
||||
// public static void error(String data) {
|
||||
// if (PRINT_ERROR)
|
||||
// Logger.error(LIB_NAME_DRAW, data);
|
||||
// }
|
||||
//
|
||||
// public static void warning(String data) {
|
||||
// if (PRINT_WARNING)
|
||||
// Logger.warning(LIB_NAME_DRAW, data);
|
||||
// }
|
||||
//
|
||||
// public static void info(String data) {
|
||||
// if (PRINT_INFO)
|
||||
// Logger.info(LIB_NAME_DRAW, data);
|
||||
// }
|
||||
//
|
||||
// public static void debug(String data) {
|
||||
// if (PRINT_DEBUG)
|
||||
// Logger.debug(LIB_NAME_DRAW, data);
|
||||
// }
|
||||
//
|
||||
// public static void verbose(String data) {
|
||||
// if (PRINT_VERBOSE)
|
||||
// Logger.verbose(LIB_NAME_DRAW, data);
|
||||
// }
|
||||
|
||||
}
|
@ -18,21 +18,18 @@ public class Initialization extends MigrationSqlStep {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(Initialization.class);
|
||||
|
||||
public static final int KARSO_INITIALISATION_ID = 1;
|
||||
public static final List<Class<?>> CLASSES_BASE = List.of(Album.class, Artist.class, Data.class, Gender.class, Playlist.class, Track.class, User.class);
|
||||
public static final List<Class<?>> CLASSES_BASE = List.of(Album.class, Artist.class, Data.class, Gender.class,
|
||||
Playlist.class, Track.class, User.class);
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Initialization";
|
||||
}
|
||||
|
||||
public Initialization() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateStep() throws Exception {
|
||||
for (final Class<?> elem : CLASSES_BASE) {
|
||||
addClass(elem);
|
||||
for (final Class<?> clazz : CLASSES_BASE) {
|
||||
addClass(clazz);
|
||||
}
|
||||
|
||||
addAction((final DBAccess da) -> {
|
||||
@ -63,6 +60,7 @@ public class Initialization extends MigrationSqlStep {
|
||||
new Gender(24L, "Bande Originale"), //
|
||||
new Gender(25L, "Variété Belge"), //
|
||||
new Gender(26L, "Gospel"));
|
||||
da.insertMultiple(data);
|
||||
});
|
||||
// set start increment element to permit to add after default elements
|
||||
addAction("""
|
||||
|
@ -1,18 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>
|
||||
%d{HH:mm:ss.SSS} [%thread] %highlight(%-5level) %logger - %msg%n
|
||||
</pattern>
|
||||
<!--
|
||||
<pattern>
|
||||
%d{HH:mm:ss.SSS} | %thread | %highlight(%-5level) | %logger - %msg%n
|
||||
</pattern>
|
||||
-->
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="CONSOLE" />
|
||||
</root>
|
||||
<!-- environment detection (defaut: dev) -->
|
||||
<property name="LOG_LEVEL_ENV" value="${LOG_LEVEL:-dev}" />
|
||||
<!-- Appender for development -->
|
||||
<if condition="property("LOG_LEVEL_ENV").equals("dev")">
|
||||
<then>
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%green(%d{HH:mm:ss.SSS}) %highlight(%-5level) %-30((%file:%line\)): %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<logger name="org.kar.karusic" level="TRACE" />
|
||||
<logger name="org.kar.archidata" level="DEBUG" />
|
||||
<root level="INFO">
|
||||
<appender-ref ref="CONSOLE" />
|
||||
</root>
|
||||
</then>
|
||||
</if>
|
||||
<!-- Appender for production -->
|
||||
<if condition="property("LOG_LEVEL_ENV").matches("^prod.*")">
|
||||
<then>
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>[%thread] %level %logger - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<root level="INFO">
|
||||
<appender-ref ref="CONSOLE" />
|
||||
</root>
|
||||
</then>
|
||||
</if>
|
||||
<if condition="property("LOG_LEVEL_ENV").equals("prod-debug")">
|
||||
<then>
|
||||
<logger name="org.kar.karusic" level="DEBUG" />
|
||||
</then>
|
||||
</if>
|
||||
<if condition="property("LOG_LEVEL_ENV").equals("prod-trace")">
|
||||
<then>
|
||||
<logger name="org.kar.karusic" level="TRACE" />
|
||||
<logger name="org.kar.archidata" level="DEBUG" />
|
||||
</then>
|
||||
</if>
|
||||
<if condition="property("LOG_LEVEL_ENV").equals("prod-trace-full")">
|
||||
<then>
|
||||
<logger name="org.kar.karusic" level="TRACE" />
|
||||
<logger name="org.kar.archidata" level="TRACE" />
|
||||
</then>
|
||||
</if>
|
||||
</configuration>
|
@ -1,42 +0,0 @@
|
||||
# SLF4J's SimpleLogger configuration file
|
||||
# Simple implementation of Logger that sends all enabled log messages, for all defined loggers, to System.err.
|
||||
# Default logging detail level for all instances of SimpleLogger.
|
||||
# Must be one of ("trace", "debug", "info", "warn", or "error").
|
||||
# If not specified, defaults to "info".
|
||||
org.slf4j.simpleLogger.defaultLogLevel=INFO
|
||||
|
||||
# Logging detail level for a SimpleLogger instance named "xxxxx".
|
||||
# Must be one of ("trace", "debug", "info", "warn", or "error").
|
||||
# If not specified, the default logging detail level is used.
|
||||
#org.slf4j.simpleLogger.log.xxxxx=
|
||||
org.slf4j.simpleLogger.log.org.kar.archidata=TRACE
|
||||
org.slf4j.simpleLogger.log.org.kar.karusic=TRACE
|
||||
|
||||
# Set to true if you want the current date and time to be included in output messages.
|
||||
# Default is false, and will output the number of milliseconds elapsed since startup.
|
||||
#org.slf4j.simpleLogger.showDateTime=false
|
||||
|
||||
# The date and time format to be used in the output messages.
|
||||
# The pattern describing the date and time format is the same that is used in java.text.SimpleDateFormat.
|
||||
# If the format is not specified or is invalid, the default format is used.
|
||||
# The default format is yyyy-MM-dd HH:mm:ss:SSS Z.
|
||||
#org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd HH:mm:ss:SSS Z
|
||||
|
||||
# Set to true if you want to output the current thread name.
|
||||
# Defaults to true.
|
||||
org.slf4j.simpleLogger.showThreadName=true
|
||||
|
||||
# Set to true if you want the Logger instance name to be included in output messages.
|
||||
# Defaults to true.
|
||||
#org.slf4j.simpleLogger.showLogName=true
|
||||
|
||||
# Set to true if you want the last component of the name to be included in output messages.
|
||||
# Defaults to false.
|
||||
#org.slf4j.simpleLogger.showShortLogName=false
|
||||
|
||||
# Utilise les codes ANSI pour la couleur
|
||||
org.slf4j.simpleLogger.warnColor=\u001B[33m
|
||||
org.slf4j.simpleLogger.errorColor=\u001B[31m
|
||||
org.slf4j.simpleLogger.infoColor=\u001B[32m
|
||||
org.slf4j.simpleLogger.debugColor=\u001B[34m
|
||||
|
@ -35,6 +35,10 @@ public class ConfigureDb {
|
||||
if (modeTestForced != null) {
|
||||
modeTest = modeTestForced;
|
||||
}
|
||||
// for local test:
|
||||
ConfigBaseVariable.apiAdress = "http://127.0.0.1:12342/test/api/";
|
||||
// Enable the test mode permit to access to the test token (never use it in production).
|
||||
ConfigBaseVariable.testMode = "true";
|
||||
final List<Class<?>> listObject = List.of( //
|
||||
Album.class, //
|
||||
Artist.class, //
|
||||
|
@ -25,8 +25,6 @@ public class TestBase {
|
||||
ConfigureDb.configure();
|
||||
LOGGER.info("configure server ...");
|
||||
webInterface = new WebLauncherTest();
|
||||
LOGGER.info("Clean previous table");
|
||||
|
||||
LOGGER.info("Start REST (BEGIN)");
|
||||
webInterface.process();
|
||||
LOGGER.info("Start REST (DONE)");
|
||||
|
@ -12,7 +12,8 @@
|
||||
"node": ">=20"
|
||||
},
|
||||
"scripts": {
|
||||
"update_packages": "ncu --upgrade",
|
||||
"update_packages": "ncu --target minor",
|
||||
"upgrade_packages": "ncu --upgrade --rejectVersion \"/^[~^<>]| - |\\.x$/\" ",
|
||||
"install_dependency": "pnpm install",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest watch",
|
||||
@ -28,18 +29,18 @@
|
||||
"*.{ts,tsx,js,jsx,json}": "prettier --write"
|
||||
},
|
||||
"dependencies": {
|
||||
"@chakra-ui/anatomy": "2.2.2",
|
||||
"@chakra-ui/cli": "2.4.1",
|
||||
"@chakra-ui/react": "2.8.2",
|
||||
"@chakra-ui/theme-tools": "2.2.6",
|
||||
"@chakra-ui/anatomy": "~2.2.2",
|
||||
"@chakra-ui/cli": "~2.4.1",
|
||||
"@chakra-ui/react": "~2.8.2",
|
||||
"@chakra-ui/theme-tools": "~2.2.6",
|
||||
"@dnd-kit/core": "6.3.1",
|
||||
"@dnd-kit/modifiers": "9.0.0",
|
||||
"@dnd-kit/sortable": "10.0.0",
|
||||
"@dnd-kit/utilities": "3.2.2",
|
||||
"@emotion/react": "11.14.0",
|
||||
"@emotion/styled": "11.14.0",
|
||||
"@formiz/core": "2.4.5",
|
||||
"@formiz/validations": "2.0.1",
|
||||
"@formiz/core": "^2.4.5",
|
||||
"@formiz/validations": "^2.0.1",
|
||||
"allotment": "1.20.2",
|
||||
"css-mediaquery": "0.1.2",
|
||||
"dayjs": "1.11.13",
|
||||
@ -67,7 +68,7 @@
|
||||
"zustand": "5.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@chakra-ui/styled-system": "2.12.0",
|
||||
"@chakra-ui/styled-system": "^2.12.0",
|
||||
"@playwright/test": "1.49.1",
|
||||
"@storybook/addon-actions": "8.4.7",
|
||||
"@storybook/addon-essentials": "8.4.7",
|
||||
|
16
front/pnpm-lock.yaml
generated
16
front/pnpm-lock.yaml
generated
@ -9,16 +9,16 @@ importers:
|
||||
.:
|
||||
dependencies:
|
||||
'@chakra-ui/anatomy':
|
||||
specifier: 2.2.2
|
||||
version: 2.2.2
|
||||
specifier: ^2.2.2
|
||||
version: 2.3.4
|
||||
'@chakra-ui/cli':
|
||||
specifier: 2.4.1
|
||||
specifier: ^2.4.1
|
||||
version: 2.4.1
|
||||
'@chakra-ui/react':
|
||||
specifier: 2.8.2
|
||||
specifier: ^2.8.2
|
||||
version: 2.8.2(@emotion/react@11.14.0(@types/react@18.3.8)(react@18.3.1))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@18.3.8)(react@18.3.1))(@types/react@18.3.8)(react@18.3.1))(@types/react@18.3.8)(framer-motion@11.15.0(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
||||
'@chakra-ui/theme-tools':
|
||||
specifier: 2.2.6
|
||||
specifier: ^2.2.6
|
||||
version: 2.2.6(@chakra-ui/styled-system@2.12.0(react@18.3.1))(react@18.3.1)
|
||||
'@dnd-kit/core':
|
||||
specifier: 6.3.1
|
||||
@ -39,10 +39,10 @@ importers:
|
||||
specifier: 11.14.0
|
||||
version: 11.14.0(@emotion/react@11.14.0(@types/react@18.3.8)(react@18.3.1))(@types/react@18.3.8)(react@18.3.1)
|
||||
'@formiz/core':
|
||||
specifier: 2.4.5
|
||||
specifier: ^2.4.5
|
||||
version: 2.4.5(react@18.3.1)
|
||||
'@formiz/validations':
|
||||
specifier: 2.0.1
|
||||
specifier: ^2.0.1
|
||||
version: 2.0.1
|
||||
allotment:
|
||||
specifier: 1.20.2
|
||||
@ -121,7 +121,7 @@ importers:
|
||||
version: 5.0.2(@types/react@18.3.8)(react@18.3.1)(use-sync-external-store@1.2.2(react@18.3.1))
|
||||
devDependencies:
|
||||
'@chakra-ui/styled-system':
|
||||
specifier: 2.12.0
|
||||
specifier: ^2.12.0
|
||||
version: 2.12.0(react@18.3.1)
|
||||
'@playwright/test':
|
||||
specifier: 1.49.1
|
||||
|
@ -3,11 +3,11 @@
|
||||
*/
|
||||
import { z as zod } from "zod";
|
||||
|
||||
import {ZodUUID} from "./uuid";
|
||||
import {ZodObjectId} from "./object-id";
|
||||
import {ZodInteger} from "./integer";
|
||||
|
||||
export const ZodRestErrorResponse = zod.object({
|
||||
uuid: ZodUUID.optional(),
|
||||
oid: ZodObjectId.optional(),
|
||||
name: zod.string(),
|
||||
message: zod.string(),
|
||||
time: zod.string(),
|
||||
|
@ -80,7 +80,6 @@ const environment_hybrid: Environment = {
|
||||
tokenStoredInPermanentStorage: false,
|
||||
};
|
||||
|
||||
export const environment = environment_local;
|
||||
|
||||
/**
|
||||
* Check if the current environment is for development
|
||||
@ -90,6 +89,9 @@ export const isDevelopmentEnvironment = () => {
|
||||
return import.meta.env.MODE === 'development';
|
||||
};
|
||||
|
||||
export const environment = isDevelopmentEnvironment() ? environment_local : environment_back_prod;
|
||||
|
||||
|
||||
/**
|
||||
* get the current REST api URL. Depend on the VITE_API_BASE_URL env variable.
|
||||
* @returns The URL with http(s)://***
|
||||
|
Loading…
x
Reference in New Issue
Block a user