Comments (7)
I don't have time just right now to answer but you can use micro.Log(err)
. It will output to log.txt
file although you will need to run micro with micro -debug
from micro.
What error message do you get when it crash?
from micro.
Hi
Many thanks for your reply.
-
I want to use the LogBuf in the same way the
plugin available
command displays output. -
I think the Log.txt is a different beast, for debugging the application.
-
I don't get an error message the console dies and disappears (It may be because I am running a batch file to launch Micro).
Kind Regards Gavin Holt
from micro.
I think the Log.txt is a different beast, for debugging the application.
Yeah
I don't get an error message the console dies and disappears (It may be because I am running a batch file to launch Micro).
Maybe try to open not with batch file? It usually say when error in plugin and what is an error. Idk if it will help but know what it prints wouldn't be bad
want to use the LogBuf in the same way the plugin available command displays output.
Ok. What I found:
micro/internal/action/command.go
Lines 103 to 114 in 2d82362
When you print > plugin available
internally micro opens logbuffer (which is io.Writer
) and sends it to another function
micro/internal/config/plugin_installer.go
Line 640 in 2d82362
that prints to buffer via fmt.Fprintln(out, <text>)
P.S it won't help with WriteLog
but you can write there as you wanted.
from micro.
-- How to detect if its already open ?
Current:OpenLogBuf()
I think no way to do it as we expected in just one line
micro/internal/action/command.go
Lines 324 to 330 in 2d82362
> log
don't check if log buffer is open it just checks if you ran it from log buffer.
> log
Ctrl+w
to switch to non logbuf> log
You will see two bufpanes with the same content. But if you run > log
from log buf, it will just close it. If you want to check if log buf is currently opened you will need to iterate thorough all the panes and check if one of them is log buf. Idk I will try to do more research
from micro.
micro/internal/action/globals.go
Lines 8 to 9 in 2d82362
It looks like a sorta bug. We have only one pointer for global LogBufPane
so we must have only one log pane at the moment. But in previous comment I said how to do it. Am I right it is a bug? @dmaluka @JoeKar
Does comment rely on the fact it is opened only by ToggleLogCmd
?
It is easy to correct for > log
dustdfg@da2d4cf but I am not sure what to do with
micro/internal/action/globals.go
Lines 30 to 36 in 2d82362
And I still don't know what causes problem of issues OP
from micro.
Hi
I have been silly. Reading the Plugins.md I found the bufffer.Log
function!
So to write to the global LogBuf is literally:
buffer.Log("Hello World")
.
However, be sure to use tostring()
beforehand as there is no built in type conversion:
buffer.Log(8) -- Fails
Kind Regards Gavin Holt
I will leave the problem of multiple Log splits for brighter minds.
from micro.
Related Issues (20)
- Child split pane is "lost" as a result of resizing its parent split pane HOT 5
- Tabmove duplicates tab when tab contains splits HOT 1
- micro shows previous mangled text when scrolling up after resizing the terminal HOT 9
- Proposal: Add relative window coordinates API HOT 4
- [question] Is this project still actively maintained? HOT 4
- Micro sometimes doesn't properly open HOT 10
- `-clean` option doesn't replace folders with proper files
- [BUG 100% reproducible] "invalid memory address or nil pointer dereference" when creating a non-existing file HOT 6
- `Clipboard erorr check` isn't after method that can cause it
- Is it possible to save file to stdin of another program? HOT 1
- Problems with key bindings (using KiTTY) HOT 3
- How to remove the background so it uses the configuration from the terminal? HOT 2
- Pressing `Down` when have "visual multiline selection" moves cursor to the second line of selection instead of end
- [Feature request]: autocomplete filetypes
- Help using func (*Buffer) FindNext HOT 2
- `SetActive` doesn't properly work (at least in plugins) HOT 2
- Micro do not save file and reopen old file HOT 17
- Does log pane must have one instance? HOT 6
- Micro uses foot's `bright7` color instead of `default` listed in color scheme file HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micro.