-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathlog.h
More file actions
31 lines (26 loc) · 847 Bytes
/
log.h
File metadata and controls
31 lines (26 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// This file is part of SmallBASIC
//
// Copyright(C) 2024 Chris Warren-Smith.
//
// This program is distributed under the terms of the GPL v2.0 or later
// Download the GNU Public License (GPL) from www.gnu.org
//
#pragma once
#include "config.h"
#if defined(ANDROID_MODULE)
#include <android/log.h>
#if defined(_DEBUG)
#define deviceLog(...) __android_log_print(ANDROID_LOG_ERROR, "smallbasic", __VA_ARGS__)
#else
#define deviceLog(...) __android_log_print(ANDROID_LOG_INFO, "smallbasic", __VA_ARGS__)
#endif
#else
#define deviceLog(...) printf(__VA_ARGS__)
#endif
#if defined(_DEBUG)
#define trace(...) deviceLog(__VA_ARGS__)
#else
#define trace(...)
#endif
#define logEntered() trace("%s entered (%s %d)", __FUNCTION__, __FILE__, __LINE__);
#define logLeaving() trace("%s leaving (%s %d)", __FUNCTION__, __FILE__, __LINE__);