console.ts 378 B

123456789101112131415
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. @external("env", "puts")
  6. declare function printf(a: ArrayBuffer): i32;
  7. export function log(a: string): void {
  8. printf(String.UTF8.encode(a, true));
  9. }
  10. export function log_number(a: number): void {
  11. printf(String.UTF8.encode(a.toString()));
  12. }