Refactor backend folder structure (#4505)

* Refactor backend folder structure

Co-authored-by: Charles Bochet <charles@twenty.com>

* fix tests

* fix

* move yoga hooks

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Weiko
2024-03-15 18:37:09 +01:00
committed by GitHub
parent afb9b3e375
commit 2c09096edd
523 changed files with 1386 additions and 1856 deletions

View File

@ -0,0 +1,30 @@
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
import {
LoggerModuleOptions,
LoggerDriverType,
} from 'src/engine/integrations/logger/interfaces';
/**
* Logger Module factory
* @param environment
* @returns LoggerModuleOptions
*/
export const loggerModuleFactory = async (
environmentService: EnvironmentService,
): Promise<LoggerModuleOptions> => {
const driverType = environmentService.get('LOGGER_DRIVER');
const logLevels = environmentService.get('LOG_LEVELS');
switch (driverType) {
case LoggerDriverType.Console: {
return {
type: LoggerDriverType.Console,
logLevels: logLevels,
};
}
default:
throw new Error(
`Invalid logger driver type (${driverType}), check your .env file`,
);
}
};