// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// This module is browser compatible.

import { getLogger } from "./get_logger.ts";
import type { GenericFunction } from "./logger.ts";

/** Log with info level, using default logger. */
export function info<T>(msg: () => T, ...args: unknown[]): T | undefined;
export function info<T>(
  msg: T extends GenericFunction ? never : T,
  ...args: unknown[]
): T;
export function info<T>(
  msg: (T extends GenericFunction ? never : T) | (() => T),
  ...args: unknown[]
): T | undefined {
  // Assist TS compiler with pass-through generic type
  if (msg instanceof Function) {
    return getLogger("default").info(msg, ...args);
  }
  return getLogger("default").info(msg, ...args);
}

// denoCacheMetadata={"headers":{"content-type":"text/typescript","x-robots-tag":"noindex","x-jsr-backend":"modules","server":"cloudflare","etag":"\"89cad8db10932ea0489080758e76a803\"","set-cookie":"__cf_bm=oAIKpjLk2mNE3hQHiaIHyLbb1BiTs9Nno1IkZmGg27U-1785241875.126026-1.0.1.1-xmTxQdSsgsmCAPhrsGygtneqhYx4dTk5DHB_pqfC1puAxsQ4p.xbp9LaSGOkYz3cZ0Ejc3zmjajj7oyCidX8r5yVZ256I3nEBKtnH7rPOuzXUJrnvlmChlonDcNn5pdV; HttpOnly; SameSite=None; Secure; Path=/; Domain=jsr.io; Expires=Tue, 28 Jul 2026 13:01:15 GMT","nel":"{\"report_to\":\"cf-nel\",\"success_fraction\":0.0,\"max_age\":604800}","alt-svc":"h3=\":443\"; ma=86400","x-content-type-options":"nosniff","vary":"Origin","report-to":"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=rovNuEBJbCaAo6sOgBeAtIWNn4l2GGzKkppLBrWQmEZielRky4NLTy%2BeY99dV7iKfLhem%2BmbX4GqnQ67LzYi27dXJu79SqzKnJniMqaMB1D0aaleyMHCfwc%3D\"}]}","access-control-allow-origin":"*","content-length":"755","date":"Tue, 28 Jul 2026 12:31:15 GMT","cache-control":"public, max-age=31536000, immutable","cross-origin-resource-policy":"cross-origin","access-control-expose-headers":"*","cf-ray":"a223e65789ce7db6-LAX","content-security-policy":"default-src 'none'; script-src 'none'; style-src 'none'; img-src 'none'; font-src 'none'; connect-src 'none'; frame-src 'none'; object-src 'none'; frame-ancestors 'none'; sandbox; form-action 'none';"},"url":"https://jsr.io/@std/log/0.224.7/info.ts","time":1785241875}