You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: log.rs
    path of file: ./repos/encore/runtimes/js/src
    
    the code of the file until where you have to start completion: use crate::api::Request;
use encore_runtime_core::error::{AppError, StackFrame, StackTrace};
use encore_runtime_core::log::Fields;
use encore_runtime_core::log::LogFromExternalRuntime;
use encore_runtime_core::log::LogLevel as CoreLogLevel;
use napi::{Env, Error};
use napi_derive::napi;
use std::collections::HashMap;

/// A logger that can be used to log messages from the runtime.
#[napi]
pub struct Logger {
    pub(crate) logger: encore_runtime_core::log::Logger,
}

#[napi]
pub enum LogLevel {
    Trace = 1,
    Debug,
    Info,
    Warn,
    Error,
    Fatal,
}

impl Into<CoreLogLevel> for LogLevel {
    fn into(self) -> CoreLogLevel {
        match self {
            LogLevel::Trace => CoreLogLevel::Trace,
         
    
fn convert_error(env: Env, input: Option<napi::JsObject>) -> napi::Result<Option<AppError>> {
    match input {
        None => Ok(None),
        Some(input) => {
            let message: napi::JsUnknown = input.get_named_property("message")?;
            let message = message.coerce_to_string()?;
            let message: String = env.from_js_value(message)?;

            // try to convert the JS stack trace
            let stack: napi::Result<napi::JsUnknown> = input.get_named_property("stack");
            let stack = stack
                .map(|unknown| parse_js_stack(&env, unknown).unwrap_or(vec![]))
                .unwrap_or(vec![]);

            Ok(Some(AppError {
                message,
                stack,
                cause: None,
            }))
        }
    }
}