You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-06-15 22:00:26 +02:00
Publish Comprehensive Rust 🦀
This commit is contained in:
11
src/android/logging/Android.bp
Normal file
11
src/android/logging/Android.bp
Normal file
@ -0,0 +1,11 @@
|
||||
rust_binary {
|
||||
name: "hello_rust_logs",
|
||||
crate_name: "hello_rust_logs",
|
||||
srcs: ["src/main.rs"],
|
||||
rustlibs: [
|
||||
"liblog_rust",
|
||||
"liblogger",
|
||||
],
|
||||
prefer_rlib: true,
|
||||
host_supported: true,
|
||||
}
|
29
src/android/logging/src/main.rs
Normal file
29
src/android/logging/src/main.rs
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright 2022 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// ANCHOR: main
|
||||
//! Rust logging demo.
|
||||
|
||||
use log::{debug, error};
|
||||
|
||||
/// Logs a greeting.
|
||||
fn main() {
|
||||
logger::init(
|
||||
logger::Config::default()
|
||||
.with_tag_on_device("rust")
|
||||
.with_min_level(log::Level::Trace),
|
||||
);
|
||||
debug!("Starting program.");
|
||||
error!("Something went wrong!");
|
||||
}
|
Reference in New Issue
Block a user