[codenameone-discussions] Re: logfile

2016-12-04 Thread howudodat1

The problem though, unless I'm missing something, is in a thread, with an 
unhandled crash the code checks isCrashBound, 
(CodenameOneThread#handleException) which would be false and so would never 
call the newly installed logger (Log.e())
public static void handleException(Throwable err) {
if(Log.isCrashBound()) {
Log.e(err);
Log.sendLog();
}
}


On Sunday, December 4, 2016 at 5:05:22 PM UTC-8, Dave Dyer wrote:
>
>
> See this post, which includes a snippet that extracts stack traces using a 
> temporary logfile.
> You can adapt this to capture all the log events - but except for stack 
> traces I think you're
> better off using a private mechanism to log info.
>
>
> https://groups.google.com/forum/#!searchin/codenameone-discussions/logfile%7Csort:relevance/codenameone-discussions/kCbXGCqmt2o/N6vvLXtECQAJ
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/056f3090-e2d6-4f36-a5fe-483edcd717e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: logfile

2016-12-04 Thread Dave Dyer

See this post, which includes a snippet that extracts stack traces using a 
temporary logfile.
You can adapt this to capture all the log events - but except for stack 
traces I think you're
better off using a private mechanism to log info.

https://groups.google.com/forum/#!searchin/codenameone-discussions/logfile%7Csort:relevance/codenameone-discussions/kCbXGCqmt2o/N6vvLXtECQAJ

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/211aa836-f6be-427a-bab6-5f5b6011bc54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: logfile

2016-12-02 Thread Shai Almog
You can file an RFE for that although I'm not sure when we'll get around to 
it. 3.6 is already overbooked and 3.7 is filling up quickly with tasks.

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/9c0e15e7-c683-4e3c-8b57-924cc1cf5b62%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: logfile

2016-12-02 Thread howudodat1
ok, so I have a situation that requires some flexibility.  The tablets are 
air gapped so using the "cloud based crash reporting" wont work.  We can 
use email based reporting (they can save the logfile as a draft and then 
send when they are connected)

However the sendlog function is static (not instance based) so I cant 
override it.  Can the following, or similar, change be made?  Or is there 
another way to send the log?

public static void sendLog() {
if (instance != null) instance._sendLog();
}

protected void _sendLog() {
    current sendLog continues here .





On Tuesday, October 4, 2016 at 8:04:02 PM UTC-7, Shai Almog wrote:
>
> Not much beyong the javadocs as far as I recall. Our official way for 
> reading is the sendLog() method which we use a lot but it's a pro feature.
> Writing is just Log.p(),Log.e() where you can just write whatever you want 
> into the log. I don't have experience in reading the log other than sendLog 
> since that works for us.
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/15ee2403-664e-45ea-9997-ca96ce09b615%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: logfile

2016-10-10 Thread Dave Dyer

I use this code to capture the contents of a log file.  Its a bit obscure 
because it threads
a needle through the standard codename1 class "Log" to create a temporary 
log file.

class LogCapture extends Log
{Log oldLog;
StringWriter myWriter;
LogCapture() 
{ oldLog = Log.getInstance();
  install(this);  
}
protected Writer createWriter() throws IOException 
{return(myWriter = new StringWriter());
}

public String dispose()
{
install(oldLog);
return(myWriter.toString());
}
}

then, this code can capture a stack trace as a string

public static String getStackTrace(Throwable t)
{
LogCapture cap = new LogCapture();
Log.e(t);
return cap.dispose();
}

Rather than redirect System.out, I use my own redirectable printer for 
debugging 
messages. Depending on the situation, I redirect it to a network stream, a 
string 
builder, or a logging window that's part of my app.


-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/fc2d8587-7127-4cbd-9c33-120672d181bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: logfile

2016-10-09 Thread Shai Almog
Log.e() prints the stack trace etc. Grabbing system out/err is a bit of a 
technical challenge across platforms.

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/824b8d28-d349-49f9-b721-3fceab161674%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: logfile

2016-10-09 Thread Peter Carlson
I am interested in getting the stacktrace.  In my desktop java apps I 
redirect System.out and Sytem.err  uploading to a website I already 
have, but others might be intersted in that.


Peter


On 10/07/2016 09:02 PM, Dave Dyer wrote:
assuming you have a web site to receive it, some simple perl can suck 
in whatever is posted to it
and store it to a permanent log.   I use this for debugging and 
catching the unexpected from deployed

applications.

The biggest trick is getting a stack trace (which is also a "pro" 
feature for no good reason IMO).


I can share my code to (1) get stacktraces (2) post them to a web site 
(3) receive and log them.
The particular code I use may not be suitable for everyone, but the 
general methods ought to

be part of any deployed application.


--
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/e85638d3-8b8d-1edc-7119-4318cdf30281%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: logfile

2016-10-04 Thread Shai Almog
Not much beyong the javadocs as far as I recall. Our official way for 
reading is the sendLog() method which we use a lot but it's a pro feature.
Writing is just Log.p(),Log.e() where you can just write whatever you want 
into the log. I don't have experience in reading the log other than sendLog 
since that works for us.

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/400eb9f0-8176-48c2-99f2-18195aa1af69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.