You need to be logged in to post in the forums. If you do not have an account, please sign up first.

6. May 2008, 23:05:55

shogun70

Posts: 2

console.log

Is there going to be equivalents for the firebug command line API?
i.e. console.log, console.debug, console.info, console.warn, console.assert, etc

See http://getfirebug.com/console.html for more.

6. May 2008, 23:12:06

Opera Software

dstorey

Posts: 237

This is something that we've discussed at least, but no commitment on that yet.
<q>Knowledge speaks, but wisdom listens.</q> - Jimi Hendrix

David Storey, Chief Web Opener, Product Manager Opera Dragonfly, Opera Software ASA

7. May 2008, 10:41:11

rexxars

Posts: 1

Well, it would make DragonFly much, much better if you did.
Having the same naming conventions, or at least aliases made would also be nice - that way the script could be run in firebug and dragonfly without modifying the source.

7. May 2008, 15:07:40

fearphage

Trained Swordsman of Unwanted Opera Termination

Posts: 2231

To add to this, latest version of webkit/safari support it.
Always latest weekly; XP Pro SP2
My bugs / disable RSS subscription prompt (This will disable email and chat as well) / Receive emailed copies of your bug reports

quote from desktopteam blog Feb 23 2007 06:49.36 (direct link to comment)

Originally posted by borg:

we will not be satisfied before we have the best developer tools in the industry

Source: Mozilla Links - 5 things I’d like to see in Opera

Originally posted by Percy Cabello:

One of the main reasons I prefer Firefox is that it starts from the belief that it can’t be the ideal browser for everybody

7. May 2008, 15:35:00

porneL

79% geek, 47% nerd

Posts: 2629

There's
window.opera.postError

7. May 2008, 16:47:36 (edited)

fearphage

Trained Swordsman of Unwanted Opera Termination

Posts: 2231

@porneL: the point is that console.log has become a standard.

@devs: Keep in mind firefox has console dot warn, info, log, error, and debug to distinguish between levels of importance. Here is a relatively complete listing with a description of each.
Always latest weekly; XP Pro SP2
My bugs / disable RSS subscription prompt (This will disable email and chat as well) / Receive emailed copies of your bug reports

quote from desktopteam blog Feb 23 2007 06:49.36 (direct link to comment)

Originally posted by borg:

we will not be satisfied before we have the best developer tools in the industry

Source: Mozilla Links - 5 things I’d like to see in Opera

Originally posted by Percy Cabello:

One of the main reasons I prefer Firefox is that it starts from the belief that it can’t be the ideal browser for everybody

8. May 2008, 14:35:25 (edited)

porneL

79% geek, 47% nerd

Posts: 2629

Different log levels would be nice, but if you want console.log working, you can add something like this to user.js:
window.console = window.console || {} /* don't overwrite console if there is one */
console.log || (console.log = opera.postError)

7. May 2008, 20:47:09

fearphage

Trained Swordsman of Unwanted Opera Termination

Posts: 2231

function debug(text) {
  ((window.console && console.log) ||
   (window.opera && opera.postError) ||
   window.alert).call(this, text);
}
Something i use commonly... but that's beside the point.

Native support of console.* would be optimal though.

@porneL: Where'd you get that invalid syntax from?
console ||= {}
o rly?
console = {log: opera.postError}
Always latest weekly; XP Pro SP2
My bugs / disable RSS subscription prompt (This will disable email and chat as well) / Receive emailed copies of your bug reports

quote from desktopteam blog Feb 23 2007 06:49.36 (direct link to comment)

Originally posted by borg:

we will not be satisfied before we have the best developer tools in the industry

Source: Mozilla Links - 5 things I’d like to see in Opera

Originally posted by Percy Cabello:

One of the main reasons I prefer Firefox is that it starts from the belief that it can’t be the ideal browser for everybody

8. May 2008, 18:40:07

FataL

Opera freak

Posts: 1443

+1
I would hate to write error logging dispatcher layer for each browser...
Please make it compatible.
Main browser and mail: 9.27 • Secondary: 10.63 (still has annoying UI regressions: inability to detach tab normally, passes source file w/o extension to external editors)
extendopera.orgReport bugs to public BTS

13. May 2008, 20:40:53

Opera Software

hallvors

Opera Software

Posts: 1668

I think I can indicate a bit more comittment than David could earlier in the thread smile
Dragonfly needs a better console, including support for the console.* API. It's going to happen.
--
My blog: miscoded
Stupid code from major websites uncovered and criticised
Contribute site fixes! - OTW&TA- all sites must work

19. June 2008, 11:34:26

+1

Looking forward very much to see it implemented. I hope the console.* methods will support n arguments, so that you don't have to concatenate stuff with "+", like you currently have to in the developer tools of Safari.

It would also be great to be able to further explore something you logged. For example if it is a Reference to a dom object it would be great to highlight it, if it an some object with members I'd like to see them etc.

6. July 2008, 20:15:17

viggen

Posts: 13

+1

Would be really great if this was implemented, at least console.log... but it would also be nice to have native support for different levels of logging.

11. September 2008, 01:32:47

cheshrkat

Posts: 16

+1 to supporting console.log() ... stuff like this creates significant barriers to getting developers to test in Opera.
--- http://www.200ok.com.au/
--- The future has arrived, it's just not
--- evenly distributed. - William Gibson

18. September 2008, 17:40:50

fearphage

Trained Swordsman of Unwanted Opera Termination

Posts: 2231

Keep in mind the sending of LIVE elements to the log is a key feature there. By live i mean "click to inspect" a genuine javascript object. console.assert and console.debug are also quite good.
Always latest weekly; XP Pro SP2
My bugs / disable RSS subscription prompt (This will disable email and chat as well) / Receive emailed copies of your bug reports

quote from desktopteam blog Feb 23 2007 06:49.36 (direct link to comment)

Originally posted by borg:

we will not be satisfied before we have the best developer tools in the industry

Source: Mozilla Links - 5 things I’d like to see in Opera

Originally posted by Percy Cabello:

One of the main reasons I prefer Firefox is that it starts from the belief that it can’t be the ideal browser for everybody

17. October 2008, 14:00:43

mykell

Posts: 2

+1 this would be really useful

21. October 2008, 12:20:21

LordMax10

Posts: 474

Hi to all

Originally posted by fearphage:

By fearphage Wednesday, 7. May 2008, 20:47:09function debug(text) {
((window.console && console.log) ||
(window.opera && opera.postError) ||
window.alert).call(this, text);
}Something i use commonly... but that's beside the point.Native



Really great.
I'll use me too.
^__^

Originally posted by fearphage:


support of console.* would be optimal though.



fully subscribe

10. November 2008, 11:57:02

Opera Software

virtuelvis

Posts: 136

To everyone adding "+1" as a reply in this thread: We are planning on supporting the Console API, and we are aware of what other implementations support in this regard, so there really is no need to add to this thread.

As an aside: I'm sorry, as usual, we can't be specific with timelines, nor with making forward-looking statements about exactly how the feature will work, but we will do our best to make the feature a strong one.
Arve

Opera Software ASA.

10. November 2008, 15:15:37

FataL

Opera freak

Posts: 1443

console.log feature can benefit not only web developers but also all Opera users, because I see ocasionly sites where devs left console.log uncommented and it brokes in Opera then.
Last example I saw: http://www.themaninblue.com/experiment/Cubescape
After you click on any "cube creation " it starts drawing cube by cube, and there is a button "Stop animation" which doesn't work...
P.S. More good cubescape examples.
Main browser and mail: 9.27 • Secondary: 10.63 (still has annoying UI regressions: inability to detach tab normally, passes source file w/o extension to external editors)
extendopera.orgReport bugs to public BTS

19. November 2008, 19:24:14

FataL

Opera freak

Posts: 1443

Hallvors, dstorey, why not include something like that in User JS now? So web devs will benefit now and users will too (see my previous comment):
if (window.opera && !window.console) {
    window.console = {};
    var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
    "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
    for (var i = 0; i < names.length; ++i)
        window.console[names[i]] = function() {}
    window.console.info = function() {
        opera.postError(arguments);
    }
}
If your argument that is something is comming for next Opera Dragonfly, it will come for Opera 9.5+, but web devs still need to test in Opera 9.2x too...
Main browser and mail: 9.27 • Secondary: 10.63 (still has annoying UI regressions: inability to detach tab normally, passes source file w/o extension to external editors)
extendopera.orgReport bugs to public BTS

19. November 2008, 20:40:50

fearphage

Trained Swordsman of Unwanted Opera Termination

Posts: 2231

@FataL: that is a lackluster implementation. Why shouldn't all the functions just point to opera.postError? I personally use console.log and console.debug but never console.info.
Always latest weekly; XP Pro SP2
My bugs / disable RSS subscription prompt (This will disable email and chat as well) / Receive emailed copies of your bug reports

quote from desktopteam blog Feb 23 2007 06:49.36 (direct link to comment)

Originally posted by borg:

we will not be satisfied before we have the best developer tools in the industry

Source: Mozilla Links - 5 things I’d like to see in Opera

Originally posted by Percy Cabello:

One of the main reasons I prefer Firefox is that it starts from the belief that it can’t be the ideal browser for everybody

19. November 2008, 22:53:38

FataL

Opera freak

Posts: 1443

@fearpage: it's not "lackluster implementation" -- it's just a quick fix for Opera not pretending to be Firebug Lite Console. wink
Main browser and mail: 9.27 • Secondary: 10.63 (still has annoying UI regressions: inability to detach tab normally, passes source file w/o extension to external editors)
extendopera.orgReport bugs to public BTS

19. November 2008, 23:51:54

fearphage

Trained Swordsman of Unwanted Opera Termination

Posts: 2231

My suggestion to fill the temporary gap:
if (window.opera && !window.console) {
  window.console = {};
  function fn() { opera.postError(arguments); };
  ['log', 'debug', 'info', 'warn', 'error', 'assert', 'dir', 'dirxml', 'group', 'groupEnd',
   'time', 'timeEnd', 'count', 'trace', 'profile', 'profileEnd'].forEach(function(name) {
    window.console[name] = fn;
  });
}
Always latest weekly; XP Pro SP2
My bugs / disable RSS subscription prompt (This will disable email and chat as well) / Receive emailed copies of your bug reports

quote from desktopteam blog Feb 23 2007 06:49.36 (direct link to comment)

Originally posted by borg:

we will not be satisfied before we have the best developer tools in the industry

Source: Mozilla Links - 5 things I’d like to see in Opera

Originally posted by Percy Cabello:

One of the main reasons I prefer Firefox is that it starts from the belief that it can’t be the ideal browser for everybody

20. November 2008, 04:25:00

FataL

Opera freak

Posts: 1443

@fearphage: Array.forEach is not supported by Opera 9.27... And seems that officially not supported in Opera 9.5 at least.
Main browser and mail: 9.27 • Secondary: 10.63 (still has annoying UI regressions: inability to detach tab normally, passes source file w/o extension to external editors)
extendopera.orgReport bugs to public BTS

20. November 2008, 14:41:09

fearphage

Trained Swordsman of Unwanted Opera Termination

Posts: 2231

Originally posted by FataL:

Array.forEach is not supported by Opera 9.27

Dragonfly works in 9.5 and greater so that is moot.

Originally posted by Dragonfly release blog post:

Support for Dragonfly in Opera 9.5 beta 2



Originally posted by FataL:

And seems that officially not supported in Opera 9.5 at least.

I think that is a bug/fault in the documentation. Opera has supported all the array methods of js 1.6 since 9.5... i think

The main point and difference between my code and yours was that all functions "work" to some extent instead of doing nothing. The forEach was just a style preference.
Always latest weekly; XP Pro SP2
My bugs / disable RSS subscription prompt (This will disable email and chat as well) / Receive emailed copies of your bug reports

quote from desktopteam blog Feb 23 2007 06:49.36 (direct link to comment)

Originally posted by borg:

we will not be satisfied before we have the best developer tools in the industry

Source: Mozilla Links - 5 things I’d like to see in Opera

Originally posted by Percy Cabello:

One of the main reasons I prefer Firefox is that it starts from the belief that it can’t be the ideal browser for everybody

4. May 2009, 13:19:42

fearphage

Trained Swordsman of Unwanted Opera Termination

Posts: 2231

Can anyone pin console.log to a core version at the least?
Always latest weekly; XP Pro SP2
My bugs / disable RSS subscription prompt (This will disable email and chat as well) / Receive emailed copies of your bug reports

quote from desktopteam blog Feb 23 2007 06:49.36 (direct link to comment)

Originally posted by borg:

we will not be satisfied before we have the best developer tools in the industry

Source: Mozilla Links - 5 things I’d like to see in Opera

Originally posted by Percy Cabello:

One of the main reasons I prefer Firefox is that it starts from the belief that it can’t be the ideal browser for everybody

13. May 2009, 09:25:31

Opera Software

dstorey

Posts: 237

Fearpage: Quite possibly Presto 2.4
<q>Knowledge speaks, but wisdom listens.</q> - Jimi Hendrix

David Storey, Chief Web Opener, Product Manager Opera Dragonfly, Opera Software ASA

13. May 2009, 13:35:54

fearphage

Trained Swordsman of Unwanted Opera Termination

Posts: 2231

Originally posted by dstorey:

Quite possibly Presto 2.4

cry That is a long ways off. Assuming 2.2 goes final before 2010. We're looking at multiple years. *sad face*
Always latest weekly; XP Pro SP2
My bugs / disable RSS subscription prompt (This will disable email and chat as well) / Receive emailed copies of your bug reports

quote from desktopteam blog Feb 23 2007 06:49.36 (direct link to comment)

Originally posted by borg:

we will not be satisfied before we have the best developer tools in the industry

Source: Mozilla Links - 5 things I’d like to see in Opera

Originally posted by Percy Cabello:

One of the main reasons I prefer Firefox is that it starts from the belief that it can’t be the ideal browser for everybody

13. May 2009, 13:36:56

fearphage

Trained Swordsman of Unwanted Opera Termination

Posts: 2231

Originally posted by dstorey:

Quite possibly Presto 2.4

cry That is a loooong ways off. Assuming 2.2 goes final before 2010. We're looking at multiple years. *sad face*
Always latest weekly; XP Pro SP2
My bugs / disable RSS subscription prompt (This will disable email and chat as well) / Receive emailed copies of your bug reports

quote from desktopteam blog Feb 23 2007 06:49.36 (direct link to comment)

Originally posted by borg:

we will not be satisfied before we have the best developer tools in the industry

Source: Mozilla Links - 5 things I’d like to see in Opera

Originally posted by Percy Cabello:

One of the main reasons I prefer Firefox is that it starts from the belief that it can’t be the ideal browser for everybody

30. July 2010, 22:27:39

lucienm

Posts: 1

I'm late, but i just see that Opera now supports console.log().

Forums » Dev.Opera » Opera Dragonfly Discussions