Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need 'Add log' for ipfs add #1353

Open
whyrusleeping opened this issue Jun 10, 2015 · 9 comments
Open

need 'Add log' for ipfs add #1353

whyrusleeping opened this issue Jun 10, 2015 · 9 comments
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature

Comments

@whyrusleeping
Copy link
Member

One big problem I have is that i will add something, and then forget the hash. I need a way to go and look up things that i've already added. This also has the added bonus of being able to go through and see which pins you want to remove when cleaning up your disk.

@whyrusleeping whyrusleeping added kind/enhancement A net-new feature or improvement to an existing feature difficulty: easy help wanted Seeking public contribution on this issue labels Jun 10, 2015
@wking
Copy link
Contributor

wking commented Jun 10, 2015

On Wed, Jun 10, 2015 at 09:22:12AM -0700, Jeromy Johnson wrote:

I need a way to go and look up things that i've already added.

First pass at a UI:

$ ipfs log add

sorted by increasing addition timestamps. I'd make the timestamps for
“when we started the addition call” but avoid logging the entry until
the addition successfully completed. We might also want to log the
completion time? And I'm not sure how to balance races (especially if
we're sorting by start-time) in writing out the entries, since it's
nice to have append-only logs, but it's also nice to be able to bisect
down to since/before limits.

Potential arguments:

  • --date (like ‘git log --date=…’)
  • --format (like ‘git log --format=…)
  • --since (only list entries with addition-timestamps >
    (≥?) that timestamp)
  • --before (only list entries with addition-timestamps <
    that timestamp)
  • --argument (only list entries with glob(7) matches for this
    pattern)
  • --hash (only list entries that created this hash. Maybe
    globbed?)
  • --pinned= (only list entries that are currently pinned (or
    aren't currently pinned, depending on the boolean value)

@jbenet
Copy link
Member

jbenet commented Jun 10, 2015

  • git reflog

@wking
Copy link
Contributor

wking commented Jun 10, 2015

On Wed, Jun 10, 2015 at 12:32:57PM -0700, Juan Batiz-Benet wrote:

  • git reflog

I love reflog, but it's about recording the history of mutable
pointers (e.g. what has my ‘HEAD’ pointer been pointing to?).
Archiving that sort of information would hook into ‘ipfs name publish
…’ (and maybe also name resolution that gets external IPNS records?),
but it's not very similar to add logging.

We likely do want it's expiration handling though.

@rht
Copy link
Contributor

rht commented Jun 15, 2015

ui issue aside, is this to be put as an eventlog or util/log? From the codebase, util/log's output is os.Stderr, not a file. Since they are both going to be unified, I suppose the final output is file.
And I recall from the discussion that any process using log.EventBegin will output through http instead.

Or I wonder if the ui discussion drives the consensus of what should be logged to file (e.g. "HEAD's log" / any operation that mutates local dag, if there is a HEAD hash to summarize the local blocks at a given time).
So there are 3 outputs (os.Stderr, file, http).

@jbenet
Copy link
Member

jbenet commented Jun 17, 2015

@rht this is a different kind of "log" than the eventlog and util/log. those are code/implementation logs, this is more a logical user-operation log. we'd want this as a structured log (probably an ipfs object)

any operation that mutates local dag, if there is a HEAD hash to summarize the local blocks at a given time).

yeah, exactly. we'd have things like:

  • adding objects
  • adding/removing pins
  • gc-ing objects out

@whyrusleeping whyrusleeping mentioned this issue Jun 23, 2015
34 tasks
@whyrusleeping whyrusleeping mentioned this issue Jul 1, 2015
44 tasks
@jbenet jbenet mentioned this issue Jul 16, 2015
58 tasks
@leni536
Copy link

leni536 commented Aug 13, 2015

(I'm new to IPFS and unfimiliar with golang). Isn't adding is basically building the ipfs objects then pinning the root? I think a pin log would be more useful in the future, maybe logging if the pinning was initiated from an add, a get or an explicit pin command too. Then of course the add log could be simply implemented by filtering the pin log.

@rht
Copy link
Contributor

rht commented Aug 13, 2015

@leni536 want to make this?

What about rht@0fed045
(ipfs get shouldn't have been there because it doesn't pin).
The remaining things to do

  1. put the logger in the necessary places
  2. make the filter command itself.
  3. (optional) version the pin states

@leni536
Copy link

leni536 commented Aug 13, 2015

Yeah, seems easy enouigh, it will be my first interaction with go though. I think I will start with 1. and 2., I know nothing about how the pin state is stored or if it could be a subject to change later.

Some random thoughts:
I see efforts to push many things to the dag anyway. Maybe logs shouldn't be exception. What about having a log node definition, containing the date (maybe in unix epoch format), link to the added hash, link to its parent log entry, an enum for the method how it's added (pin or add) and enum for pin type (which would contain 'unpinned' too to mark unlinks)?

/random thoughts

I will be happy to implement a simple text log right now though.

@whyrusleeping
Copy link
Member Author

I think we will want it to be a dag eventually, but I also think that doing so will require a lot more design work to figure out how to do that correctly. For now, if we just do a text log i think it would be good.

@RichardLitt RichardLitt added exp/expert Having worked on the specific codebase is important and removed difficulty: moderate labels Feb 2, 2016
@RichardLitt RichardLitt added help wanted Seeking public contribution on this issue and removed help wanted Seeking public contribution on this issue labels May 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

6 participants