forked from DSpace/dspace-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
startup-message.ts
19 lines (16 loc) · 751 Bytes
/
startup-message.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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('');
}