lasso 9 console tips and question

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

lasso 9 console tips and question

mail

This is a resend... not sure why the content was stripped out. The
formatting was set to "Rich Text" I will try this one as "Plain Text"
As part of my development process with Lasso I constantly use the
console mode to check for debugging, writing out messages, and to
capture MySQL statements for testing. However, in Lasso 9 it is not so
clear how to accomplish the same. I typically make use of a wrapper tag
so that what I log stands out

    define_tag('lc',-Required='input',-Priority='Replace');
        Log_Always('*-*-*-*-*-*-* '+(string(@#input)->trim &));
    /define_tag;

I understand I can use tail command to view logging:

  tail -F -50 /private/var/lasso/instances/default/lasso.out.txt

To make it easy to re-use that command, I create a .bash_profile alias
as follows, in terminal:

echo "alias lasso9='sudo tail -F -50
/private/var/lasso/instances/default/lasso.out.txt'" >> ~/.bash_profile

Then I can just type "lasso9" to get the console view running.

Or, to open the Instance manager:

 http://localhost/lasso9/instancemanager/

and, then click on the icon for logs.

Or, use view the "Lasso Server :: Admin" "Log Book" page, open browser
and enter:

http://localhost/lasso9/Admin/logbook

However,  in all three cases, what is logged is not complete. I see I
can use various log tags to write to that log and view output. But, how
do I get Lasso to write out all MySQL statements to this log? I did try
to edit the Lasso Log Book Settings and checked off "Console" for the
SQL item, but that does not have the desired effect, the MySQL
statements are not written to console.

I ALSO have a question about the documentation (at
http://www.lassoguide.com/operations/logging.html). It states the
following:

"The built-in log levels include: ...
Console
The Lasso 9 Server instance’s console window. Viewable if Lasso 9
Server is started in console mode."

What exactly does that mean? How do I start in "console mode"?

Anyone have something to add to these tips?

Michael

#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

RE: lasso 9 console tips and question

Rick Draper-2
Hi Michael,

I am always watching the console log and use a healthy scattering of:

stdoutnl('Some useful prefix: ' + #whatever + '**')

You can also use log_critical if you want a date/time stamp.... never found any limitations

Very best regards,

Rick



#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: lasso 9 console tips and question

Jonathan Guthrie-3
In reply to this post by mail
As Rick said - log to "critical" and make sure crit is set not to log got db.
Look at the instance home path, and look for lasso.out.txt and tail that in terminal.
If you work it right you'll get way more info from L9 than any previous version - stack trace and all.
http://lassoguide.com/language/error-handling.html

Console mode - just tail the log as stated above and you'll be fine.

I have marked that chapter for review however.
But be wary - L9 will log what you ask, and only that (thank God) unlike previous versions.



On 2013-08-07, at 1:28 AM, <[hidden email]> wrote:

>
> This is a resend... not sure why the content was stripped out. The
> formatting was set to "Rich Text" I will try this one as "Plain Text"
> As part of my development process with Lasso I constantly use the
> console mode to check for debugging, writing out messages, and to
> capture MySQL statements for testing. However, in Lasso 9 it is not so
> clear how to accomplish the same. I typically make use of a wrapper tag
> so that what I log stands out
>
>   define_tag('lc',-Required='input',-Priority='Replace');
>       Log_Always('*-*-*-*-*-*-* '+(string(@#input)->trim &));
>   /define_tag;
>
> I understand I can use tail command to view logging:
>
> tail -F -50 /private/var/lasso/instances/default/lasso.out.txt
>
> To make it easy to re-use that command, I create a .bash_profile alias
> as follows, in terminal:
>
> echo "alias lasso9='sudo tail -F -50
> /private/var/lasso/instances/default/lasso.out.txt'" >> ~/.bash_profile
>
> Then I can just type "lasso9" to get the console view running.
>
> Or, to open the Instance manager:
>
> http://localhost/lasso9/instancemanager/
>
> and, then click on the icon for logs.
>
> Or, use view the "Lasso Server :: Admin" "Log Book" page, open browser
> and enter:
>
> http://localhost/lasso9/Admin/logbook
>
> However,  in all three cases, what is logged is not complete. I see I
> can use various log tags to write to that log and view output. But, how
> do I get Lasso to write out all MySQL statements to this log? I did try
> to edit the Lasso Log Book Settings and checked off "Console" for the
> SQL item, but that does not have the desired effect, the MySQL
> statements are not written to console.
>
> I ALSO have a question about the documentation (at
> http://www.lassoguide.com/operations/logging.html). It states the
> following:
>
> "The built-in log levels include: ...
> Console
> The Lasso 9 Server instance’s console window. Viewable if Lasso 9
> Server is started in console mode."
>
> What exactly does that mean? How do I start in "console mode"?
>
> Anyone have something to add to these tips?
>
> Michael
>

Jono

----------------------------
Jonathan Guthrie
[hidden email]
@iamjono
LassoSoft Inc.
AIM Chatroom: lassochat
IRC/freenode #lasso


#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

RE: lasso 9 console tips and question

mail
In reply to this post by mail


#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

RE: lasso 9 console tips and question

mail
In reply to this post by mail
I thought the line in the documentation was telling me that there was
some alternate way to start Lasso that would open it in the console...
as with previous versions.
"The Lasso 9 Server instance’s console window. Viewable if Lasso 9
Server is started in console mode."

Since I am only looking for messages in the console, "log_always" should
work and not add those messages to other logs, as would be the case with
log_critical?

How do I log all MySQL statements as before?

I also tried putting this tag at the top of my page to be processed:

    log_setDestination(log_level_sql,log_destination_console)

Still do not see those mysql statements.

Michael


#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: lasso 9 console tips and question

Ke Carlton-3
To approach things from another tangent you could always used L-Debug's
console mode:

debug->activate('console')


From there your entire debug stack is dumped to the console, all of your
methods etc are rendered nicely and timed. It's great for large tasks you
want to debug and/or threads running in the back ground. All in all, it's
fairly slick.

Within a thread you can do:

public active_tick => {

debug->activate('console')

// do some stuff

}

Here's an example:

debug->activate('console')

define mytag => debug => {

local(sql) = 'SELECT *
FROM nothhere
WHERE 1 = 2'

inline(-database = 'edi',-sql = #sql)
debug->found
debug->sql
/inline

}

mytag


And the console output:

http://pastebin.com/RgTCkxxy
http://oi39.tinypic.com/2wnqtrm.jpg


┌──── void > mytag ─────────────────────────────────────┐
| ERROR:  Table 'edi.nothhere' doesn't exist
| Found 0 rows
|
| // SQL
| SELECT *
| FROM nothhere
| WHERE 1 = 2
| 0.008553
└───────────────────────────────────────────────────────┘


You can also use the same stack for debugging in a browser during active
development.

Ke

#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: lasso 9 console tips and question

Ke Carlton-3
Maybe I should also point out that methods are requirement:

debug('my search') => {
inline(-database = 'edi',-sql = #sql) => {
debug->found
debug->sql
}
}


Ke

#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: lasso 9 console tips and question

Ke Carlton-3
— methods are * not * requirement.

On 7 August 2013 13:55, Ke Carlton <[hidden email]> wrote:

> Maybe I should also point out that methods are requirement:
>

#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>