Skip to content

[Log] Set log level using 'loglevel' package #427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 27, 2024
Merged

[Log] Set log level using 'loglevel' package #427

merged 2 commits into from
May 27, 2024

Conversation

Neet-Nestor
Copy link
Contributor

This PR introduces a new package, logLevel, which is a lightweight logging javascript library for managing logging levels and filtering debug logs in production.

https://github.com/pimterry/loglevel

We exposed logLevel as part of the engine config to allow users to modify it. The default log level is WARN.

In TRACE level:
Screenshot 2024-05-26 at 6 45 43 PM

In WARN level:
Screenshot 2024-05-26 at 6 53 27 PM

@Neet-Nestor Neet-Nestor merged commit 44edca1 into mlc-ai:main May 27, 2024
1 check passed
@Neet-Nestor Neet-Nestor deleted the log_lvel branch May 27, 2024 21:53
CharlieFRuan added a commit that referenced this pull request May 30, 2024
### Changes
Main changes include:
- New prebuilt models:
  - Phi3-mini
  - StableLM-2-zephyr-1.6B
  - Qwen1.5-1.8B
  - Hermes2-Pro-Llama-3-8B to prebuilt models
- Updates on `ModelRecord` fields
  - For detail see: #435
- Update all WASMs
  - For detail see: #433
  - Update all WASMs to v0.2.39
- Support grammar for Llama3, hence update examples/json-mode to use
`Llama3` and `Hermes2-pro-Llama3-8B` for function calling in
`examples/json-schema`
- Use `loglevel` package:
  - For details see #427
- Fix `index.js.map` issue for Vite
  - #420
- Enhance error handling and ServiceWorker

### TVMjs
TVMjs compiled at
apache/tvm@71f7af7
- Main changes include: 
  - apache/tvm#17031
  - apache/tvm#17028
  - apache/tvm#17021

### WASM version
- All wasms updated to 0.2.39 via
mlc-ai/binary-mlc-llm-libs#123 for new MLC-LLM
runtime (mainly grammar)
CharlieFRuan pushed a commit that referenced this pull request May 31, 2024
Follow up from #427 to prevent the following type issue introduced on
`v0.2.39`:

<img width="1328" alt="image"
src="https://github.com/mlc-ai/web-llm/assets/418083/3b2d028f-71af-4e77-a779-e4176225b92a">

This issue fails type-checking
[[reference](https://github.com/felladrin/MiniSearch/actions/runs/9298738476/job/25591213310?pr=356)]
and forces users to define the `logLevel` config.
But in fact, `logLevel` already has a default value and was intended to
be an optional parameter.
This PR fixes it.
jingyi-zhao-01 pushed a commit to jingyi-zhao-01/web-llm that referenced this pull request Dec 8, 2024
This PR introduces a new package, `logLevel`, which is a lightweight
logging javascript library for managing logging levels and filtering
debug logs in production.

https://github.com/pimterry/loglevel

We exposed `logLevel` as part of the engine config to allow users to
modify it. The default log level is `WARN`.

In `TRACE` level:
<img width="766" alt="Screenshot 2024-05-26 at 6 45 43 PM"
src="https://github.com/mlc-ai/web-llm/assets/23090573/1245d868-4848-4310-a4ed-b3097b0972cd">

In `WARN` level:
<img width="779" alt="Screenshot 2024-05-26 at 6 53 27 PM"
src="https://github.com/mlc-ai/web-llm/assets/23090573/0a391d55-5d40-4199-bb2b-7c02600b2460">
jingyi-zhao-01 pushed a commit to jingyi-zhao-01/web-llm that referenced this pull request Dec 8, 2024
### Changes
Main changes include:
- New prebuilt models:
  - Phi3-mini
  - StableLM-2-zephyr-1.6B
  - Qwen1.5-1.8B
  - Hermes2-Pro-Llama-3-8B to prebuilt models
- Updates on `ModelRecord` fields
  - For detail see: mlc-ai#435
- Update all WASMs
  - For detail see: mlc-ai#433
  - Update all WASMs to v0.2.39
- Support grammar for Llama3, hence update examples/json-mode to use
`Llama3` and `Hermes2-pro-Llama3-8B` for function calling in
`examples/json-schema`
- Use `loglevel` package:
  - For details see mlc-ai#427
- Fix `index.js.map` issue for Vite
  - mlc-ai#420
- Enhance error handling and ServiceWorker

### TVMjs
TVMjs compiled at
apache/tvm@71f7af7
- Main changes include: 
  - apache/tvm#17031
  - apache/tvm#17028
  - apache/tvm#17021

### WASM version
- All wasms updated to 0.2.39 via
mlc-ai/binary-mlc-llm-libs#123 for new MLC-LLM
runtime (mainly grammar)
jingyi-zhao-01 pushed a commit to jingyi-zhao-01/web-llm that referenced this pull request Dec 8, 2024
)

Follow up from mlc-ai#427 to prevent the following type issue introduced on
`v0.2.39`:

<img width="1328" alt="image"
src="https://github.com/mlc-ai/web-llm/assets/418083/3b2d028f-71af-4e77-a779-e4176225b92a">

This issue fails type-checking
[[reference](https://github.com/felladrin/MiniSearch/actions/runs/9298738476/job/25591213310?pr=356)]
and forces users to define the `logLevel` config.
But in fact, `logLevel` already has a default value and was intended to
be an optional parameter.
This PR fixes it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant