Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7663315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:01:50+00:00 2026-05-31T14:01:50+00:00

I made a custom logging class that logs certain things to a file. I’m

  • 0

I made a custom logging class that logs certain things to a file. I’m trying to make a macro so that I can use my custom class just like NSLog(), but it doesn’t seem to be working right.

Here’s how I’m defining the macro:

#define ECLog(fmt, ...) [ECLogger logText:fmt, ## __VA_ARGS__]

logText: is declared like this:

+ (void)logText:(NSString *)theString;

If I only pass one argument, it works fine. Like this:

ECLog(@"test");

But if I pass another argument, like this:

ECLog(@"test %@",someString);

I get an error that it was only expecting one argument.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T14:01:52+00:00Added an answer on May 31, 2026 at 2:01 pm

    No, the warning is about the method call. The error seems to be about the macro because you’re viewing the code before the preprocessor has worked on it, but the compiler’s pointing to the same line, post-processing.

    You’ve declared this method as taking one argument, but you’re passing it more than that.

    ECLog(@"test %@", someString);
    

    gets rewritten by the preprocessor to:

    [ECLogger logText:@"test %@", someString];
    

    That’s the literal text that is now passed to the compiler, just as if you’d typed it that way yourself. The method is declared as taking a single NSString, but you’re passing it two things. You need to change the declaration of the method:

    + (void) logText: (NSString *)theString, ...; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made a custom UIView class and trying to set up in it an
When I do web development, I use a custom made logger that catches fatal
I made a custom Static Library that I use in an iOS project. When
I made a custom control that is basically a multiline TextBox that allows input,
I made a custom master page. I also made a custom CSS file, which
I made a custom handler that derives from MvcHandler. I have my routes using
I've made a custom DataGridViewCell that displays a custom control instead of the cell;
I have made a custom UserControl i Vb.net (windows application). How can I add
Hopefully someone here can help me out - basically I have a logging class
Having problems with a custom logging system I've made. I am declaring an ofstream

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.