Giter Club home page Giter Club logo

Comments (16)

KennethWussmann avatar KennethWussmann commented on July 22, 2024 1

Better use PluginContext.Logger.log("message"); as mentioned here.

from hain.

Semigradsky avatar Semigradsky commented on July 22, 2024

I just insert console.log πŸ˜„

from hain.

ishu3101 avatar ishu3101 commented on July 22, 2024

But then where do you see the console log?

from hain.

notatestuser avatar notatestuser commented on July 22, 2024

Press F12 - it'll open devtools.

from hain.

ishu3101 avatar ishu3101 commented on July 22, 2024

Pressing F12 does nothing.

from hain.

notatestuser avatar notatestuser commented on July 22, 2024

Do you have afaaeed?

from hain.

ishu3101 avatar ishu3101 commented on July 22, 2024

No was using v0.0.2-rc4, Updated to the latest release which is v0.0.3.

from hain.

ishu3101 avatar ishu3101 commented on July 22, 2024

I have noticed that using console.log causes the plugin to break in v0.0.3 but in v0.0.2-rc4 it did not cause any problems

from hain.

sethxd avatar sethxd commented on July 22, 2024

I was having this same issue trying to use console.log. Fixed it by including this line just inside module.exports: const logger = pluginContext.logger

And calling it like this: logger.log("Hello world!")

from hain.

likerRr avatar likerRr commented on July 22, 2024

Hey everyone.

Sometimes I face an issue when DevTools shows just Object{} without any properties (except native prototype) for my objects or even null at all (but properties exist and they're accessible). Can't provide an example for the first case, because it doesn't work on simple code, but here is a simple version of the second case (lodash should be installed):

let _ = require('lodash');

module.exports = (context) => {
  return {
    startup() {
      context.logger.log(_); // null
      context.logger.log(_.identity(2)); // 2
    }
  };
};

What's the matter?

from hain.

likerRr avatar likerRr commented on July 22, 2024

@appetizermonster have ideas? ^^^

from hain.

appetizermonster avatar appetizermonster commented on July 22, 2024

There is no advanced way to debug plugins for now. we should make it.
not in docs, but you can use console.log in the plugin if you launch hain on commandline prompt. (but you should remove them in the production)
so it may be helpful for debugging.

from hain.

cpriest avatar cpriest commented on July 22, 2024

I have v0.5.2 which should include afaaeed but F12 does not do anything, F5 does however work which I see that commit also had some code in for. Is F12 expected to be working right now?

from hain.

appetizermonster avatar appetizermonster commented on July 22, 2024

@cpriest I'll take a look at it, thanks for the reporting

from hain.

abinadi avatar abinadi commented on July 22, 2024

I had the same issue as @cpriest. I'm on v0.5.2 and F12 does nothing. Not sure if it is pertinent, but I used the pre-built binary.

from hain.

DanielFallon avatar DanielFallon commented on July 22, 2024

F12 should be fixed now. F12's handler was firing, but the dev tools weren't being opened properly

see #212

from hain.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.