github.com/apptainer/singularity@v3.1.1+incompatible/cmd/starter/c/include/message.h (about) 1 /* 2 * Copyright (c) 2017-2019, SyLabs, Inc. All rights reserved. 3 * 4 * Copyright (c) 2016-2017, The Regents of the University of California, 5 * through Lawrence Berkeley National Laboratory (subject to receipt of any 6 * required approvals from the U.S. Dept. of Energy). All rights reserved. 7 * 8 * This software is licensed under a customized 3-clause BSD license. Please 9 * consult LICENSE.md file distributed with the sources of this project regarding 10 * your rights to use or distribute this software. 11 * 12 * NOTICE. This Software was developed under funding from the U.S. Department of 13 * Energy and the U.S. Government consequently retains certain rights. As such, 14 * the U.S. Government has been granted for itself and others acting on its 15 * behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software 16 * to reproduce, distribute copies to the public, prepare derivative works, and 17 * perform publicly and display publicly, and to permit other to do so. 18 */ 19 20 #ifndef _SINGULARITY_MESSAGE_H 21 #define _SINGULARITY_MESSAGE_H 22 23 #define ABRT -4 24 #define ERROR -3 25 #define WARNING -2 26 #define LOG -1 27 #define INFO 1 28 #define VERBOSE 2 29 #define VERBOSE1 2 30 #define VERBOSE2 3 31 #define VERBOSE3 4 32 #define DEBUG 5 33 34 #define ANSI_COLOR_RED "\x1b[31m" 35 #define ANSI_COLOR_GREEN "\x1b[32m" 36 #define ANSI_COLOR_YELLOW "\x1b[33m" 37 #define ANSI_COLOR_BLUE "\x1b[34m" 38 #define ANSI_COLOR_MAGENTA "\x1b[35m" 39 #define ANSI_COLOR_CYAN "\x1b[36m" 40 #define ANSI_COLOR_GRAY "\x1b[37m" 41 #define ANSI_COLOR_LIGHTGRAY "\x1b[90m" 42 #define ANSI_COLOR_LIGHTRED "\x1b[91m" 43 #define ANSI_COLOR_LIGHTGREEN "\x1b[92m" 44 #define ANSI_COLOR_LIGHTYELLOW "\x1b[93m" 45 #define ANSI_COLOR_LIGHTBLUE "\x1b[94m" 46 #define ANSI_COLOR_LIGHTMAGENTA "\x1b[95m" 47 #define ANSI_COLOR_LIGHTCYAN "\x1b[96m" 48 #define ANSI_COLOR_RESET "\x1b[0m" 49 50 void _print(int level, const char *function, const char *file, char *format, ...) __attribute__ ((__format__(printf, 4, 5))); 51 52 #define singularity_message(a,b...) _print(a, __func__, __FILE__, b) 53 54 #endif /*_SINGULARITY_MESSAGE_H */