Atmosphere/fusee/fusee-secondary/src/log.h

42 lines
1.4 KiB
C
Raw Normal View History

/*
* Copyright (c) 2018 Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FUSEE_PRINT_H
#define FUSEE_PRINT_H
#define PRINT_MESSAGE_MAX_LENGTH 512
//#include <stdint.h>
#include "../../fusee-primary/src/lib/vsprintf.h"
typedef enum {
SCREEN_LOG_LEVEL_NONE = 0,
SCREEN_LOG_LEVEL_ERROR = 1,
SCREEN_LOG_LEVEL_WARNING = 2,
SCREEN_LOG_LEVEL_MANDATORY = 3, /* no log prefix */
SCREEN_LOG_LEVEL_INFO = 4,
SCREEN_LOG_LEVEL_DEBUG = 5
} ScreenLogLevel;
/* TODO: make this configurable by BCT.ini */
extern ScreenLogLevel g_screen_log_level;
void log_set_log_level(ScreenLogLevel screen_log_level);
void log_to_uart(const char *message);
void vprint(ScreenLogLevel screenLogLevel, const char *fmt, va_list args);
void print(ScreenLogLevel screenLogLevel, const char* fmt, ...);
#endif