flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > log lvl,str

Author
Thread Post new topic Reply to topic
edfed



Joined: 20 Feb 2006
Posts: 4353
Location: Now
edfed 28 Oct 2024, 16:12
what about a log directive, like display, that will log into a .log file at compile time. not a log like we can have at runtime. this kind of logger is not the responsibility of fasm, but a display with output to a file would be appreciable.

for example:

in mycode.asm

CRIT:

LOG CRIT,"hello"
LOG WARN,"hi"

save to mycode.log only the hello line. because CRIT log level have higher priority
Post 28 Oct 2024, 16:12
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8357
Location: Kraków, Poland
Tomasz Grysztar 28 Oct 2024, 16:30
Something like this?
Code:
virtual as 'log'
  LOG::
  .level = 3
end virtual

macro log lvl, str&
{
  virtual LOG
    if lvl >= LOG.level
      db str
    end if
  end virtual
}

log 3, 'hello'
log 1, 'hi'    
Post 28 Oct 2024, 16:30
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4353
Location: Now
edfed 19 Nov 2024, 14:43
ho yeah! very very good. thank you. i will play a lot now.

i never realised it was possible to generate multiple files with a single source. very very good news for me

it can be used to make something like unit test report then.
Post 19 Nov 2024, 14:43
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.