priorities

command
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Example: Android log priority levels and their string representations.

Enumerates every Priority constant exported by ndk/log and prints its name, integer value, and the equivalent Android logcat letter.

The NDK function __android_log_write(int prio, const char *tag, const char *text) accepts these priority values as its first argument. In Go code using ndk you would pass androidlog.Debug, androidlog.Info, etc. to any API that requires a log priority.

Priority levels from lowest to highest:

Unknown (0) – should not normally appear in output
Default (1) – the default priority; logcat maps it to the minimum
Verbose (2) – extremely detailed, usually disabled in production
Debug   (3) – development diagnostics
Info    (4) – normal operational messages
Warn    (5) – unexpected but recoverable situations
Error   (6) – failures that need attention
Fatal   (7) – unrecoverable errors; typically followed by abort
Silent  (8) – suppresses all output; used only as a filter, never for writing

This program runs on the host (no Android device required) because it only inspects the constant values without calling into the NDK.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL