mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
add startup message with version number
This commit is contained in:

committed by
Samuel Cambien

parent
59f9534418
commit
c94e5d0709
19
startup-message.ts
Normal file
19
startup-message.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import PACKAGE_JSON from './package.json';
|
||||
import { BuildConfig } from './src/config/build-config.interface';
|
||||
|
||||
/**
|
||||
* Log a message at the start of the application containing the version number and the environment.
|
||||
*
|
||||
* @param environment the environment configuration
|
||||
*/
|
||||
export const logStartupMessage = (environment: Partial<BuildConfig>) => {
|
||||
const env: string = environment.production ? 'Production' : 'Development';
|
||||
const color: string = environment.production ? 'red' : 'green';
|
||||
|
||||
console.info('');
|
||||
console.info(`%cdspace-angular`, `font-weight: bold;`);
|
||||
console.info(`Version: %c${PACKAGE_JSON.version}`, `font-weight: bold;`);
|
||||
console.info(`Environment: %c${env}`, `color: ${color}; font-weight: bold;`);
|
||||
console.info('');
|
||||
|
||||
}
|
Reference in New Issue
Block a user