Skip to content
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

Example in README leads to TypeScript errors #6

Open
thomergil opened this issue Sep 22, 2023 · 1 comment
Open

Example in README leads to TypeScript errors #6

thomergil opened this issue Sep 22, 2023 · 1 comment

Comments

@thomergil
Copy link

I can't just use a plain string for logLevel. It leads to TypeScript errors. I have to do:

import VueLogger from 'vuejs3-logger'
import { LogLevels } from 'vuejs3-logger/dist/enum/log-levels'

const LOG_THRESHOLD = isProduction() ? LogLevels.ERROR : LogLevels.DEBUG
const vueLoggerOptions = {
  isEnabled: true,
  logLevel: LOG_THRESHOLD,
  stringifyArguments: false,
  showLogLevel: true,
  showMethodName: true,
  separator: '|',
  showConsoleColors: true,
}
app.use(VueLogger, vueLoggerOptions)

The README should reflect this.

@suterma
Copy link

suterma commented Oct 29, 2024

Yes, please! I just ran into this today and it is really an unnecessary first bump.

You can also just change one line

logLevel: isProduction ? LogLevels.ERROR : LogLevels.DEBUG,

To keep the original example only minimally changed.

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

No branches or pull requests

2 participants