Logger don't work.
WangLarry opened this issue · comments
Describe the bug
In react-editor, set log-leverl to debug, the console of browser display nothing.
To Reproduce
- In react-editor packages: edit src/website/Root.jsx
- Add:
import { setLogLevel, logLevels } from '@jafar/form';
setLogLevel(logLevels.DEBUG);
- In browser: console window display nothing
Expected behavior
In other packages except 'form', logger should also work.
Additional context
I think this problem come from the configure of package dependencies.
React-editor or react-form etc, configure '@jafar/form' as 'dependencies', not 'peerDependencies'.
The result is there are two '@jafar/form' in builded bundle.
- Are you running @jafar/react-editor from localhost?
- Did you run 'npm run bootstrap' from root directory of jafar? (root of all packages. you can delete also all package-lock.json if you have)
- check that your NODE_ENV === 'development' (log debug is by default shown when NODE_ENV is 'development')
- check the log type "verbose" on chrome - not the log "info"
I see the logs from localhost without any additional change:
@galhavivi
I am running @jafar/react-editor from localhost, in packages/react-editor directory, run yarn start
did you check all the 4 points i wrote above?
(if you install the package from root/packages/react-editor - it might cause the extra dependencies, thats y we run "npm run bootstrap" from root directory - to hoist all packages in root directory and local link all jafar packages - as advices for monorepo repository)
@galhavivi
done. According to your instructions, I have seen log infos. :)
Just like you say - the log level "verbose" on chrome, not "debug" or "info".
BTW: I try to analyze bundle using 'source-map-explorer', but it only analyze react-editor package, not show other package's (form, react-component etc) infos deeply.
@WangLarry
when in packages/react-editor
run "npm run build-package"
then run:
source-map-explorer build/static/js/main.xxxxx.js
i can see there "react-form", "form", "react-layout" and "react-components" once
@WangLarry about logs, ill add to the docs where each logs level can be found, especially debug messages. Thanks for your great feedbacks :)