Git Product home page Git Product logo

Comments (3)

hoto avatar hoto commented on June 12, 2024 4

I also don't understand how do you "console debug" anything using alfy without effectively breaking the workflow execution.
ATM it's either you get the debug logs or you get proper workflow execution, never both.

Any of the alfy/console logs will break the execution of the workflow:

import alfy from 'alfy'

alfy.log("my alfy.log()")
alfy.error("my alfy.error()")
console.info("my console.info()")
console.debug("my console.debug()")
console.error("my console.error()")

alfy.output(
    [
        {
            title: "My title"
        }
    ]
)

You will see the various log messages and My title being displayed in debug console, but the workflow execution will be broken, it crashes as alfred cannot parse the output.
Using any of the above logs crashes the exectuion of the workflow.

The big question here is how do you add debug log but at the same time don't crash the workflow execution?

from alfy.

sindresorhus avatar sindresorhus commented on June 12, 2024

alfy.log simply passes it to console.error. Alfred documents that you can output to stderr for debugging.

https://www.alfredforum.com/topic/9170-alfred-3-tip-use-stderr-to-output-to-the-debug-console/

from alfy.

tkambler avatar tkambler commented on June 12, 2024

I'm also confused as to how this is supposed to work. I understand that alfy.log() is simply a wrapper around console.error(); however, when I try to use it, I end up seeing two items arrays getting printed to the console, which doesn't seem right.

FYI... If I comment out the following line in Alfy, everything works as expected:

// hookStderr(alfy.error);

Alfy seems to be trying to do two conflicting things with regards to stderr:

#86 (comment)

from alfy.

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.