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

Vanilla JS? #28

Open
bfalchuk opened this issue Jan 28, 2021 · 1 comment
Open

Vanilla JS? #28

bfalchuk opened this issue Jan 28, 2021 · 1 comment

Comments

@bfalchuk
Copy link

bfalchuk commented Jan 28, 2021

newbie question - seeing unexpected error when using ololog as below. I include the lib like this:
<script src="https://unpkg.com/ololog"></script>
then i setup simply like this:

let log = ololog;
log.configure ({
  indent: { level: 3 },  //indent level
  locate:true,
  tag:true, //shows the 'iNFo' tag (or whatever) in front of msg
  time:false //timestamps
 });

but I see a console error on startup from the file get-source.js that i don't understand..

get-source.js:142 GET http://127.0.0.1:5500/index.html/ 404 (Not Found)
(anonymous) @ get-source.js:142
SyncPromise @ SyncPromise.js:9
fetchFileSync @ get-source.js:138
(anonymous) @ get-source.js:27
m @ get-source.js:17
SourceFile @ get-source.js:30
getSource @ get-source.js:113
withSource @ stacktracey.js:166
(anonymous) @ stacktracey.js:214
StackTracey.<computed> @ stacktracey.js:312
withSources @ stacktracey.js:214
clean @ stacktracey.js:237
locate @ ololog.js:119
modifiedFunctions.<computed> @ pipez.js:48
modifiedFunctions.<computed> @ pipez.js:48
(anonymous) @ pipez.js:23
Object.assign.configure @ pipez.js:23
(anonymous) @ logger.js:26
@xpl
Copy link
Owner

xpl commented Jan 28, 2021

I haven't checked if it works for quite a while. Seems that it tries to fetch index.html (because your script is defined there) and then it fails for some reason. As a quick fix, setting locate: false might help.

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